inoremap <expr> <tab> pumvisible() ? '<c-n>' : '<tab>' | |
inoremap <expr> <s-tab> pumvisible() ? '<c-p>' : '<tab>' | |
augroup autocomplete | |
autocmd! | |
autocmd TextChangedI * call TypeComplete() | |
augroup end | |
fun! TypeComplete() | |
if getline('.')[col('.') - 2] =~ '\K' && getline('.')[col('.') - 1] !~ '\K' | |
call feedkeys("\<c-n>") | |
end |
Searching can be an efficient way to navigate the current buffer.
The first search commands we learn are usually /
and ?
. These are seriously cool, especially with the incsearch
option enabled which lets us keep typing to refine our search pattern. /
and ?
really shine when all we want is to jump to something we already have our eyeballs on but they are not fit for every situation:
- when we want to search something that's not directly there, those two commands can make us lose context very quickly,
- when we need to compare the matches.
The operators c
, d
, and y
expect a motion, like w
, e
, etc. The second character in the following pairs is not a motion so it is a NOP and nothing is overridden if we use them in mappings.
cd cm co cp cq cr cs cu cx cy cz
dc dm dq dr ds du dx dy dz
I’ll assume you are on Linux or Mac OSX. For Windows, replace ~/.vim/
with $HOME\vimfiles\
and forward slashes with backward slashes.
Vim plugins can be single scripts or collections of specialized scripts that you are supposed to put in “standard” locations under your ~/.vim/
directory. Syntax scripts go into ~/.vim/syntax/
, plugin scripts go into ~/.vim/plugin
, documentation goes into ~/.vim/doc/
and so on. That design can lead to a messy config where it quickly becomes hard to manage your plugins.
This is not the place to explain the technicalities behind Pathogen but the basic concept is quite straightforward: each plugin lives in its own directory under ~/.vim/bundle/
, where each directory simulates the standard structure of your ~/.vim/
directory.
curl -u 'USER' https://api.github.com/user/repos -d '{"name":"REPO"}'
Replace USER
with your username and REPO
with the intended repo name. Include all quotes above.
The do the usual:
git remote add origin [email protected]:USER/REPO.git
git push origin master