How to run mvim (MacVim) from Terminal?
I don’t think I’d to add anything to the path, did brew install macvim mvim -v should then open macvim in the terminal, you can also go ahead and alias that alias vim=’mvim -v’
I don’t think I’d to add anything to the path, did brew install macvim mvim -v should then open macvim in the terminal, you can also go ahead and alias that alias vim=’mvim -v’
I personally use set wildmode=longest,list,full set wildmenu When you type the first tab hit, it will complete as much as possible. The second tab hit will provide a list. The third and subsequent tabs will cycle through completion options so you can complete the file without further keys. Bash-like would be just set wildmode=longest,list but … Read more
You need to do 2 things: create a mapping local to a specific buffer by using the <buffer> option for inoremap. load the mappings for just a specific filetype. This can be done via an autocommand in your .vimrc like so: autocmd FileType php inoremap <buffer> ( ()<Esc>i The other way option is by creating … Read more
This effect can be accomplished by using sub-replace-special substitution and setreg() linewise :let @a=”” :%s//\=setreg(‘A’, submatch(0), ‘l’)/g :%d _ :pu a :0d _ or all in one line as such: :let @a=””|%s//\=setreg(‘A’, submatch(0), ‘l’)/g|%d _|pu a|0d _ Overview: Using a substitution to append each match into register “a” linewise then replace the entire buffer with … Read more
The mapping nnoremap <esc> :noh<return><esc> will conflict with so called “grey keys” and I believe that it should be used either in GVim only or in terminal Vim by someone who does not use special keys like arrows. From what I know (and guess) how Vim processes keys, I would say that it’s impossible to … Read more
The problem is that your settings are being overridden by a filetype plugin that’s part of Vim. The issue is in ftplugin/python.vim: ” As suggested by PEP8. setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8 The python plugin attempts to setup your source code to be PEP8 compliant by default, so it’s adjusting the tabstop. You’ll want some … Read more
I had this very same problem when I started using vim. The solution is simple, you just have to edit the c syntax file used by vim, here’s how to do it: When you start editing a C or C++ file, vim reads the default c syntax file located in $VIMRUNTIME/syntax/c.vim (Where $VIMRUNTIME is where … Read more
Linux? With X, use xmodmap to alter the key mapping, e.g. xmodmap -e ‘clear Lock’ -e ‘keycode 0x42 = Escape’ Will map Esc to the CapsLock key. Google for more examples.
The best-practice way IMO is: Install Syntastic Vim plugin – Best syntax-checker around for plenty of languages, plus it integrates with Vim’s location-list (==quickfix) window. I recommend cloning from the GitHub repo and installing using a plugin manager like Vundle or Pathogen, since it’s more frequently updated. Choose one of the two options below: JSLint … Read more
You asked for it 🙂 “{{{Auto Commands ” Automatically cd into the directory that the file is in autocmd BufEnter * execute “chdir “.escape(expand(“%:p:h”), ‘ ‘) ” Remove any trailing whitespace that is in the file autocmd BufRead,BufWrite * if ! &bin | silent! %s/\s\+$//ge | endif ” Restore cursor position to where it was … Read more