Skip to content

Instantly share code, notes, and snippets.

@huydx
Last active October 12, 2015 09:38
Show Gist options
  • Save huydx/4007766 to your computer and use it in GitHub Desktop.
Save huydx/4007766 to your computer and use it in GitHub Desktop.
personal vim setup
"------personalize
:set visualbell
:syntax on
:set number
filetype plugin on
set ofu=syntaxcomplete#Complete
:set gfn=Monaco:h14
:colorscheme desert
set mouse=a
set mouse=a
set guioptions+=a
set ttymouse=xterm2
set clipboard=unnamed
:set hlsearch
"-----------set auto tab and tab indent
:set smartindent
:set tabstop=2
:set shiftwidth=2
:set noexpandtab
set clipboard+=unnamed
"----------mapping
nmap ; :
nmap ;; ;
imap <C-c> <Esc>
nmap <C-p> <Esc>:bp<CR>
nmap <C-n> <Esc>:bn<CR>
nmap <C-a> <Esc>0
nmap <C-e> <Esc>$
nmap <C-q> <Esc>:q
nmap <silent> <C-k> :wincmd k<CR>
nmap <silent> <C-j> :wincmd j<CR>
nmap <silent> <C-h> :wincmd h<CR>
nmap <silent> <C-l> :wincmd l<CR>
nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR>
if bufwinnr(1)
map + <C-W>+
map - <C-W>-
endif
"------open at start programs
autocmd VimEnter * NERDTree
autocmd VimEnter * wincmd p
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
"------map ctr-s to save file
nmap <silent> <C-s> :if expand("%") == ""<CR>browse confirm w<CR>else<CR>confirm w<CR>endif<CR>
"nmap <silent> <C-q> :if expand("%") == ""<CR>browse confirm q<CR>else<CR>confirm q<CR>endif<CR>
"------set mouse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment