Skip to content

Instantly share code, notes, and snippets.

@meowmeowxw
Last active January 9, 2020 13:24
Show Gist options
  • Save meowmeowxw/d0850154dba5dc26b4a43cee6432baee to your computer and use it in GitHub Desktop.
Save meowmeowxw/d0850154dba5dc26b4a43cee6432baee to your computer and use it in GitHub Desktop.
Minimal vim
"Created by @meowmeowxw
"Vim behaviour
set background=dark
colorscheme evening
"set termguicolors
set hls!
set laststatus=2
set tabstop=4
set softtabstop=4
set shiftwidth=4
set noexpandtab
set number
set splitbelow
set splitright
set noshowmode
set cursorline
set colorcolumn=80
"
" Custom Shortcuts
map <F6> :tabp<CR>
map <F7> :tabn<CR>
map <C-K> :5winc +<CR>
map <C-J> :5winc -<CR>
map <C-H> :5winc ><CR>
map <C-L> :5winc <<CR>
" Nvim only
map <C-T> :vsplit term://zsh<CR>
map D d$
map Y y$
nnoremap <Leader>c :set cursorline!<CR>
nnoremap <Leader>r :g/^\s*$/d<CR>
tnoremap <Esc> <C-\><C-n>
"
" automatic close bracket }
inoremap { {}<left>
inoremap {<CR> {<CR>}<ESC>O
inoremap {;<CR> {<CR>};<ESC>O
"
" Tricks for Nvim
au BufEnter * if &buftype == 'terminal' | :startinsert | endif
autocmd StdinReadPre * let s:std_in=1
augroup project
autocmd!
autocmd BufRead,BufNewFile *.h,*.c set filetype=c.doxygen
augroup END
filetype indent on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment