Skip to content

Instantly share code, notes, and snippets.

@leighghunt
Last active February 28, 2019 02:37
Show Gist options
  • Save leighghunt/7a53da1d13a382623ed122ec27f59492 to your computer and use it in GitHub Desktop.
Save leighghunt/7a53da1d13a382623ed122ec27f59492 to your computer and use it in GitHub Desktop.
vimrc
set nocompatible
execute pathogen#infect()
syntax on
filetype plugin indent on
let g:NERDTreeDirArrowExpandable = '▸'
let g:NERDTreeDirArrowCollapsible = '▾'
let g:NERDTreeNodeDelimiter = "\u00a0"
" let g:ackprg = 'ag --nogroup --nocolor --column'
let g:ackprg = 'ag --vimgrep'
set backspace=2 " Backspace deletes like most programs in insert mode
set hlsearch
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
set nowrap
" Open new split panes to right and bottom, which feels more natural
set splitbelow
set splitright
" Quicker window movement
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l
" Get off my lawn
nnoremap <Left> :echoe "Use h"<CR>
nnoremap <Right> :echoe "Use l"<CR>
nnoremap <Up> :echoe "Use k"<CR>
nnoremap <Down> :echoe "Use j"<CR>
nnoremap <F5> :NERDTree<CR>
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
@leighghunt
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment