spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
  Home » VIM » Page 1
Vim: Trying to modify the spell checker to exclude "rare" words
You could override the ]s mappings to skip rare spell errors (e.g. by checking the syntax), but the cleanest approach would be building custom spellfiles that exclude the rare words. As these are identified by the ? flag (:help spell-RARE), filtering them out should be trivial to do. Building them (:help Myspell) might be more complex; I haven't done that so far.

Categories : Vim

How to make a valid input for "xxd -r" in vim when removing a byte?
You've discovered on your own that removing the byte offset column and text column allows you to use :%!xxd -r -p to get what you want. So how about creating a custom command to remove those columns and then do the conversion? :%!xxd -r -p is too much to type, anyway. Something like: :command MyXXDR %s#^[^:]*: (\%(x+ )+) .*#1# | %!xxd -r -p This exact command may cause problems if you have mes

Categories : Vim

Using argdo with set with vim
The syntax of :argdo (as per the :help) is :argdo[!] {cmd} No quoting is involved. To execute multiple commands in one go, just separate them with |: :argdo set tabstop=4 | retab | update

Categories : Vim

Outline view with autocompletion in Vim
No need for plugins, that is built into vim. You could do , that's CTRL+X followed by : File completion : Line completion : Omni completion : Dictionary completion You could customise the pop-up window the way you like. The 'complete' option controls where the keywords are searched (include files, tag files, buffers, and more). The 'completeopt' option controls how the completion oc

Categories : Vim

Vim -- comment auto-wrapping messes up block insert
Vim does not recognize code that is commented out and normal comments. I do not think such a thing exists. Your 'formatoptions' specify that a inserted text in comments should reflow. You are inserting a comment so the comment will reflow. You can avoid this by not doing an insert but something else instead, like a substitution. :s#^#// However by far the easiest solution would be to use one of

Categories : Vim

How do I use function arguments to toggle buffer scoped variable in vim?
The issue is vim's variables have scope. Just like there is a buffer scope, b:, there are other scopes : global(g:), window(w:), script(s:), vim(v:), and argument(a:). Lets start by fixing your "toggle" function: function! Toggle(name) let b:{a:name} = !get(b:, a:name, 0) return b:{a:name} endfunction So what is going on here: use a:name to refer to the function argument a:name is the na

Categories : Vim

Efficiently navigating out of enclosed curly braces from insert mode in Vim
]}o moves to the closing brace and opens a new line below it. That's three keys to press, other than mapping it to a shorter key sequence, I fail to see how one would do it more efficiently. --- edit --- You can use this insert mode mapping to do the same thing from insert mode: inoremap <C-e> <C-o>]}<C-o>o But I obviously recommend to stay out of insert mode as long as p

Categories : Vim

Record mode in vim across multiple files
You can't record something that already happened but you can play an existing recording (saved in register q for the sake of demenstration) on every buffer in the buffer list with: :bufdo @q If what you want to repeat in other buffers is a substitution, you can do: :bufdo g& If it's an Ex command: :bufdo @:

Categories : Vim

How to use Regular Expressions with Vim ag (silver search)
ag uses the same syntax as grep: $ ag .epart. finds 'departure' and 'departed' $ ag ^The finds all lines starting with 'The' $ ag s{2} finds 'Odessa' I'm not familiar with that ag.vim plugin but I guess that something like the following should find all lines ending with Oz: :Ag Oz$ Refer to $man grep for the gory syntax details.

Categories : Vim

How to move to the end of column
There's no general answer to this question, a lot depends on context (which your artificial example lacks), and you also have to consider that a sequence with more keypresses that you instantly remember is quicker than the optimal sequence that you have to remember first, or even backtrack because of a wrong motion. If the actual block is longer, }Bl is a good general choice. With my JumpToVerti

Categories : Vim

Vim + solarized + terminator = keywords highlighted in black
Colorscheme authors can build their own palette from a 16,777,216 colors palette for GUI colorschemes, the 256 colors xterm palette for 256-colors terminal emulators and the 16, user-configurable, named ANSI colors in other cases. The obvious consequence is that it is extremely difficult to come up with a colorscheme that is guaranteed to look the same everywhere. The choice I've made with my co

Categories : Vim

Vim Undo command (the one with the with capital U)
In my understanding all latest changes means going back the change history until a change in a different line is encountered, and stop there. So if you start with an empty buffer and edit only one line (repeatedly), all additions will be wiped by U. Vim generally merges near changes occurring in the same line; these appear as a single entry in :changes.

Categories : Vim

How to insert at the very left of the line in vim?
Use gI instead of I. From :help gI : gI gI Insert text in column 1 [count] times. {not in Vi}

Categories : Vim

Can Vim apply shiftround to a block as a whole instead of linewise?
Ctrl+V, select vertical column before the text you need to shift (j in your case of just two lines), Shift+I, insert needed number of tabs or spaces, Esc. You can actually use this method to insert arbitrary text, for example you can insert # or // to comment some code. More info in :help blockwise-operators.

Categories : Vim

Remapping ; and , in vim
Another plugin has grabbed those keys with mappings; you can find the plugin with :verbose map ; :verbose map , To fix this, change the plugin's default mappings to some other key(s).

Categories : Vim


Recently Add
Open the file by searching tag in vim
Vim: Trying to modify the spell checker to exclude "rare" words
How to make a valid input for "xxd -r" in vim when removing a byte?
Using argdo with set with vim
Outline view with autocompletion in Vim
Vim -- comment auto-wrapping messes up block insert
How do I use function arguments to toggle buffer scoped variable in vim?
Efficiently navigating out of enclosed curly braces from insert mode in Vim
Record mode in vim across multiple files
How to use Regular Expressions with Vim ag (silver search)
How to move to the end of column
Vim + solarized + terminator = keywords highlighted in black
Vim Undo command (the one with the with capital U)
How to insert at the very left of the line in vim?
Can Vim apply shiftround to a block as a whole instead of linewise?
Remapping ; and , in vim
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.