Skip to content

Instantly share code, notes, and snippets.

@KorvinSilver
Last active January 16, 2022 08:32
Show Gist options
  • Save KorvinSilver/02e872945f4d03df97f1fd686e9bfbc9 to your computer and use it in GitHub Desktop.
Save KorvinSilver/02e872945f4d03df97f1fd686e9bfbc9 to your computer and use it in GitHub Desktop.
My vim config to amix/vimrc
" Set shell
set shell=/bin/zsh
" Enable Pathogen built-in plugin
execute pathogen#infect('bundle/{}', '~/.vim_runtime/my_plugins/{}')
" Enable AutoSave plugin
" https://github.com/vim-scripts/vim-auto-save.git
" let g:auto_save = 1
" let g:auto_save_no_updatetime = 1 " do not change the 'updatetime' option
" let g:auto_save_in_insert_mode = 0 " do not save while in insert mode
" Set file encoding to UTF-8
set fileencoding=utf8
" Set Syntastic passive mode
let b:syntastic_mode = "passive"
" Set EOL unix style
set ff=unix
" Tell vim explicitly to use BOM
set bomb
" Show number of each line
set number
set numberwidth=5
" Set size of GVim window
if(has("gui_running"))
set lines=32 columns=128
endif
filetype plugin indent on
" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces
set expandtab
" Remove trailing whitespaces on save
fun! StripTrailingWhitespace()
" Don't strip on these filetypes
if &ft =~ 'markdown'
return
endif
%s/\s\+$//e
endfun
autocmd BufWritePre * call StripTrailingWhitespace()
" Get off my lawn - helpful when learning Vim
nnoremap <Left> :echoe "Use h"<CR>
nnoremap <Right> :echoe "Use l"<CR>
nnoremap <Up> :echoe "Use k"<CR>
nnoremap <Down> :echoe "Use j"<CR>
" Use spell checking
set spell
set spl=en_us spell
" Fuzzy finder: ignore stuff that can't be opened, and generated files
let g:fuzzy_ignore = "*.png;*.PNG;*.JPG;*.jpg;*.GIF;*.gif;vendor/**;coverage/**;tmp/**;rdoc/**"
" Overwrites font settings
" Set font according to system
if has("mac") || has("macunix")
set gfn=Hack:h10,Inconsolata:h10,Source\ Code\ Pro:h10,Menlo:h10
elseif has("win16") || has("win32")
set gfn=Hack:h10,Inconsolata:h10,Source\ Code\ Pro:h10,Bitstream\ Vera\ Sans\ Mono:h10
elseif has("gui_gtk2")
set gfn=Hack\ 10,Inconsolata\ 10,Monospace\ 10
elseif has("linux")
set gfn=Hack\ 10,Inconsolata\ 10,Monospace\ 10
elseif has("unix")
set gfn=Hack\ 10,Inconsolata\ 10,Monospace\ 10
endif
" Disable folding
" set nofoldenable
" Enable folding
set foldenable
" Set markdown conceal level
set conceallevel=2
" Disable instant markdown preview autoload
" Note: to enable on the fly, type: :InstantMarkdownPreview
let g:instant_markdown_autostart = 0
" Change default cursor highlight in GVim and disable in Vim
:hi CursorLine gui=NONE guifg=NONE guibg=DarkSlateGrey
if(has("gui_running"))
set cursorline
else
set nocursorline
endif
" Disable Go version warning message in Vim 7
let g:go_version_warning = 0
" Map Ctrl+L to Esc
imap <C-L> <Esc>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment