Skip to content

Instantly share code, notes, and snippets.

@rednebmas
Last active April 20, 2018 17:09
Show Gist options
  • Select an option

  • Save rednebmas/20d47bf919e38ab11efd6a1bfcfeb945 to your computer and use it in GitHub Desktop.

Select an option

Save rednebmas/20d47bf919e38ab11efd6a1bfcfeb945 to your computer and use it in GitHub Desktop.
My Vim config file
"" Important installed plugins:
""
"" YouCompleteMe
"" http://www.alexeyshmalko.com/2014/youcompleteme-ultimate-autocomplete-plugin-for-vim/
""
"" Airline status bar
execute pathogen#infect()
""
"" Basics
""
set hlsearch
syntax on
filetype plugin indent on
set number " Line numbers
set incsearch " Start searching before pressing enter [e.g. incremental search]
set showmatch " Show matching parenthesis
set smartcase " ignore case if search pattern is all lowercase,
" case-sensitive otherwise
set history=1000 " remember more commands and search history
set undolevels=1000 " use many muchos levels of undo
set wildignore=*.swp,*.bak,*.pyc,*.class
set title " change the terminal's title
set novisualbell " don't beep
set noerrorbells " don't beep
set nobackup
set noswapfile
set fo+=n " format lists as indented, see :help fo-table, https://stackoverflow.com/a/6732761/337934
set ignorecase " ignore case when searching
" Center screen after searching
nnoremap n nzz
nnoremap N Nzz
nnoremap * *zz
nnoremap # #zz
nnoremap g* g*zz
nnoremap g# g#zz
" Easy split navigation, might want to change to buffer
map <D-S-H> <C-w>h
map <D-S-J> <C-w>j
map <D-S-K> <C-w>k
map <D-S-L> <C-w>l
""
"" NERDTREE
""
map <C-n> :NERDTreeToggle<CR>
" How can I close vim if the only window left open is a NERDTree?
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
""
"" Control-p - fuzzy file search
"" https://github.com/kien/ctrlp.vim
""
set runtimepath^=~/.vim/bundle/ctrlp.vim
""
"" 4-space tab indent
""
set tabstop=4
set softtabstop=0 noexpandtab
set shiftwidth=4
""
"" Airline status bar
""
if has("gui_running")
set guifont=Source\ Code\ Pro\ for\ Powerline:h17 "make sure to escape the spaces in the name properly
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1 " Enable the list of buffers
let g:airline#extensions#tabline#fnamemod = ':t' " Show just the filename
endif
" Automatically read file if there were changes
set autoread
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment