Skip to content

Instantly share code, notes, and snippets.

@taoy
Last active February 14, 2020 03:45
Show Gist options
  • Save taoy/5619b164cc2880f4cdf1 to your computer and use it in GitHub Desktop.
Save taoy/5619b164cc2880f4cdf1 to your computer and use it in GitHub Desktop.
Sample Simple vimrc
set title
syntax on
set hidden
set nowrap
set textwidth=98
set shiftwidth=4
set tabstop=4
set expandtab
set softtabstop=4
set shiftround
colorscheme elflord
set background=dark
set vb
set ai
set modeline
set autochdir
set ruler
set number
set hlsearch
set cursorline
set laststatus=2
set statusline=[%n]\ %F%m%r%h%w\ \ \ \ (%Y)\
set statusline+=%#ErrorMsg#
set statusline+=%{khuno#Status()}%*
set statusline+=%*
set statusline+=\%=%{fugitive#statusline()}\ %-3v\ Current:\ %-4l\ Total:\ %-4L\ (%p%%)\ \ %P
set runtimepath+=~/.vim
set runtimepath+=~/.vim/qfixapp
" Leader Key and some key customize
nnoremap <Space> <Nop>
let mapleader = "\<Space>"
noremap <Leader>s :%s/
nnoremap <Leader>w :w<CR>
nnoremap <Leader>q :q!<CR>
nnoremap <Leader>p :e ~/.pythonhist<CR>
nnoremap <Leader>v :e ~/.vimrc<CR>
nmap <silent><Leader>x <Esc>:Khuno show<CR>
nnoremap <CR> G
nnoremap <BS> gg
"Window navigation
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
nmap <silent> ,/ :nohlsearch<CR>
" GitSessions
nnoremap [GS] <Nop>
nmap <Leader>g [GS]
nnoremap <silent> [GS]s :GitSessionSave<CR>
nnoremap <silent> [GS]l :GitSessionLoad<CR>
nnoremap <silent> [GS]d :GitSessionDelete<CR>
let g:gitsessions_dir = '.vimsessions/'
let python_highlight_all=1
" syntastic
" let g:syntastic_python_checkers = ['flake8']
" python-jedi
let g:jedi#use_tabs_not_buffers = 0
let g:jedi#autocompletions_command = "<tab>"
" QfixHowm
let QFixHowm_Key = ','
let howm_dir = '~/Documents/memos/'
let howm_filename = '%Y/%m/%Y-%m-%d-%H%M%S.txt'
let howm_fileencoding = 'utf-8'
let howm_fileformat = 'unix'
let QFixHowm_FileType = 'markdown'
let QFixHowm_ReminderPriority = {'@' : 1, '!' : 1, '+' : 3, '-' : 4, '~' : 5, '.' : 6}
let QFixHowm_ListReminder_ScheExt = '[-@+!~]'
" MRU
let MRU_Max_Entries = 1000
let MRU_Exclude_Files = '^/tmp/.*\|^/var/tmp/.*'
" Indent Guide
let g:indent_guides_color_change_percent = 30
let g:indent_guides_auto_colors = 0
let g:indent_guides_guide_size = 1
let g:indent_guides_start_level = 2
hi IndentGuidesOdd ctermbg=darkgrey
hi IndentGuidesEven ctermbg=white
" Khuno
let g:khuno_builtins = "_,apply"
let g:khuno_ignore = "E16, E402, N806"
let g:khuno_max_line_length = 98
" TagList
nnoremap # @
nmap @ :Tlist<CR>
nmap # :TagExplorer<CR>
set tags=./tags
set tags+=.git/tags
" Emmet
let g:user_emmet_leader_key=','
" Make a simple "search" text object.
vnoremap <silent> s //e<C-r>=&selection=='exclusive'?'+1':''<CR><CR>
\:<C-u>call histdel('search',-1)<Bar>let @/=histget('search',-1)<CR>gv
omap s :normal vs<CR>
autocmd FileType gitv call s:my_gitv_settings()
function! s:gitv_get_current_hash()
return matchstr(getline('.'), '\[\zs.\{7\}\ze\]$')
endfunction
function! s:my_gitv_settings()
setlocal iskeyword+=/,-,.
nnoremap <silent><buffer> C :<C-u>Git checkout <C-r><C-w><CR>
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment