Skip to content

Instantly share code, notes, and snippets.

@camilosampedro
Created October 19, 2018 02:31
Show Gist options
  • Save camilosampedro/4876e148aeae29c4e3992c7f40d25ee3 to your computer and use it in GitHub Desktop.
Save camilosampedro/4876e148aeae29c4e3992c7f40d25ee3 to your computer and use it in GitHub Desktop.
VIM config
execute pathogen#infect()
syntax on
filetype plugin indent on
let g:terraform_align=1
set number
highlight LineNr term=bold cterm=NONE ctermfg=129 ctermbg=NONE gui=NONE guifg=DarkGrey guibg=NONE
set numberwidth=1
set backspace=indent,eol,start
set clipboard=unnamed
"set paste
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal! g'\"" | endif
endif
nnoremap <C-L> :tabnext<CR>
nnoremap <C-Right> :tabnext<CR>
nnoremap <C-H> :tabp<CR>
nnoremap <C-Left> :tabp<CR>
nnoremap <silent> <C-n> :tabedit <CR>
vnoremap <C-c> "*y
set splitbelow
set splitright
set mouse=a
if has("mouse_sgr")
set ttymouse=sgr
else
set ttymouse=xterm2
end
" Tab Navigation
"" For Mac OS
nnoremap <silent> ˙ :wincmd h<CR>
nnoremap <silent> ∆ :wincmd j<CR>
nnoremap <silent> ˚ :wincmd k<CR>
nnoremap <silent> ¬ :wincmd l<CR>
"" NERDTree
"Open nerdtree when no files specified
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
"Open nerdtree when opening directory
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
nnoremap <F5> :NERDTreeToggle<CR>
"syntax enable
set background=light
"set background=
"colorscheme solarized
let g:airline_theme='angr'
"let g:airline_solarized_bg='dark'
" Enable the list of buffers
let g:airline#extensions#tabline#enabled = 1
" Show just the filename
let g:airline#extensions#tabline#fnamemod = ':t'
" This allows buffers to be hidden if you've modified a buffer.
" This is almost a must if you wish to use buffers in this way.
set hidden
" To open a new empty buffer
" This replaces :tabnew which I used to bind to this mapping
nmap <leader>T :enew<cr>
" Move to the next buffer
nmap <leader>l :bnext<CR>
" Move to the previous buffer
nmap <leader>h :bprevious<CR>
" Close the current buffer and move to the previous one
" This replicates the idea of closing a tab
nmap <leader>bq :bp <BAR> bd #<CR>
" Show all open buffers and their status
nmap <leader>bl :ls<CR>
set showcmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment