Skip to main content

Home/ VIM Editor/ Contents contributed and discussions participated by reckoner reckoner

Contents contributed and discussions participated by reckoner reckoner

reckoner reckoner

different background color for Insert/Normal mode - vim_use | Google Groups - 0 views

  • > I want to customize vimrc to change background color to yellow when switched to > "Insert mode".  It should be easy but I can not find how to do it. Any help will > be appreciated. > regards,   :au InsertEnter * hi Normal term=reverse ctermbg=darkgrey guibg=yellow   :au InsertLeave * hi Normal term=NONE    ctermbg=black    guibg=white Change to taste. see         :help InsertEnter         :help InsertLeave         :help :autocmd         :help :highlight
reckoner reckoner

clipboarded: vim as an IDE - 0 views

  • File exploringAlright. You need two plugins, NERDTree and BufExplorer.NERDTree is started by typing :NERDTree and it will give you a much better file explorer than any other IDE. BufExplorer is started by typing \be and it will allow you to access a list of recently used files, and switch between them quickly.You might also want to bone up on windows and tabs (:help windows and :help tabs)
reckoner reckoner

Tip #21 - easy pasting to windows apps : vim online - 0 views

  • In Vim, the unnamed register is the " register, and the Windows Clipboard is the * register. This means that if you yank something, you have to yank it to the * register if you want to paste it into a Windows app. If this is too much trouble, set the 'clipboard' option to 'unnamed'. Then you always yank to *. So pasting to windows apps doesn't require prefixing "* :   set   clipboard=unnamed
  • You can also have the Visual selection automatically copied to the clipboard.  If you :set go+=a
reckoner reckoner

pasting to command line - vim_use | Google Groups - 0 views

  • > What's the way for pasting to command line? The usual way I use is    :put It's linewise, but there are some stunts (coming to mind: abusing :substitute and control+r to pull in content from various registers) It also takes a register, so if you want the system clipboard, you can do    :put * -tim
reckoner reckoner

apply function to substitution? - vim_use | Google Groups - 0 views

  • is this possible: > :%s/\(.*\)/some_function(\1)/g > where some_function is something I would define myself. Python has this > function, BTW. > Thanks in advance.         :%s/.*/\=some_function(submatch(0))/ see         :help sub-replace-special         :help submatch() Note that since the * operator is greedy, .* matches the whole line, therefore the g flag doesn't change anything (there is only one whole line on each line).
  •  
    apply function to matched group in substitution
reckoner reckoner

matchparen++ - Improvement over standard matchparen plugin : vim online - 0 views

  • mproves over standard matchparen.vim plugin by echoing line containing matching bracket in the status line so you can quickly see which block is terminated by this paren.  Also scans for braces/parens which are off-screen.
  •  
    this is good for brace-based languages like C++
reckoner reckoner

Tip #227 - Power of :g : for more context - 0 views

  • Display context (5 lines) for all occurences of a pattern     :g/<pattern>/z#.5     :g/<pattern>/z#.5|echo "=========="     << same as first, but with some beautification >> Delete all lines matching a pattern     :g/<pattern>/d Delete all blank lines (just an example for above)     :g/^\s*$/d Double space the file     :g/^/pu =\"\n\"     :g/^/pu _     << the above one also works >> Copy all lines matching a pattern to end of file     :g/<pattern>/t$ Yank all lines matching a pattern to register 'a'     0"ay0:g/<pattern>/y A Increment the number items from current line to end-of-document by one     :.,$g/^\d/exe "normal! \<c-a>" Comment (C) lines containing "DEBUG" statements     g/^\s*DEBUG/exe "norm! I/* \<Esc>A */\<Esc>" A Reverse lookup for records (eg: An address book, with Name on start-of-line and fields after a space)     :g/<patern>?^\w?p               "if only name is interested     :g/<patern>/ka|?^\w?p|'ap       "if name and the lookup-line is interested     :g/<patern>/?^\w?|+,/^[^ ]/-1p  "if entire record is interested Reverse a file (just to show the power of 'g')     :g/^/m0
reckoner reckoner

To switch back to normal mode automatically after inaction - Vim Tips Wiki - a Wikia wiki - 0 views

  • " set 'updatetime' to 15 seconds when in insert mode au InsertEnter * let updaterestore=&updatetime | set updatetime=15000 au InsertLeave * let &updatetime=updaterestore
reckoner reckoner

GVim Portable Home Page - 0 views

  • The GVim Portable Launcher allows you to run GVim from a removable drive whose letter changes as you move it to another computer. The program can be entirely self-contained on the drive and then used on any Microsoft Windows computer.
reckoner reckoner

idle timeout to automatically leave insert mode? - vim_use | Google Groups - 0 views

  • > Due to a repetitive stress injury, I have heavily customized the keys > in VIM. I don't know this is possible, but it would help there were an > automatic exit out of insert mode after a fixed idle duration. This > would save me having to hit the<ESC>  key so frequently to exit insert > mode. In other words, once in insert mode, after not hitting any keys > for 2 seconds or so, VIM would automatically take me out of insert > mode w/o me  having to hit the<ESC>  key. > I hope that made sense. > Thanks in advance         :au CursorHoldI * stopinsert will take you out of Insert mode when you don't type anything for 'updatetime' milliseconds (default 4000). To make it 2 seconds, add         :set ut=2000
reckoner reckoner

Tip #1439 - Using vim as an IDE all in one : vim online - 0 views

  • I've read a lot of tips about how to make vim as an IDE like editor. Most of them are really useful, and I want to sum up them in this tip, and then add some of my experiences.
reckoner reckoner

Vim Color Editor HOW-TO (Vi Improved with syntax color highlighting) - 0 views

  • If a file type you want to use is not detected, then there are two ways to add it.
  •  
    how to customize syntax highlighting for new types fileTypes
reckoner reckoner

The Clewn project -- gdb vim - 0 views

  • Clewn implements full gdb support in the vim editor: breakpoints, watch variables, gdb command completion, assembly windows, etc.
reckoner reckoner

what are safe key combinations to remap in vim - vim_use | Google Groups - 0 views

  • You can refer to the "Finding unused keys" section in the "Mapping keys in Vim" tutorial available at: http://vim.wikia.com/wiki/Mapping_keys_in_Vim_-_Tutorial_%28Part_2%29
  • eta keys are almost always safe (<M-A>, <M-B>, etc.). Check for mappings from plugins, etc. before using. When in doubt, use the help. For example, to see if CTRL-J is taken (it is, but there are several commands to do the same thing) type :help CTRL-J and then press CTRL-D instead of ENTER to list all results. Then view each result to see what they do and if there are any alternate ways to do the same thing before mapping. If the mapping is for one mode only, you can prepend the mode. For example, for CTRL-J in insert mode, :help i_CTRL-J
  • Oh, and you can also use the map leader (see :help <Leader>), which defaults to the backslash key. For example, nmap <leader>h :echo "hello world!"<CR>
reckoner reckoner

Preexisting code indentation - Vim Tips Wiki - a Wikia wiki - 0 views

  • lternative: if your file has indent 4 and you want an indent of 3 and gg=G is not working as expected, try :set inde=indent(v:lnum)/4*3 then go ahead with the well known gg=G use tabs or spaces, doesn't matter
‹ Previous 21 - 40 of 136 Next › Last »
Showing 20 items per page