vimrc updates
This commit is contained in:
parent
1fea47103e
commit
fff033d7ea
|
@ -1,2 +1,5 @@
|
|||
vim/.vim/bundle/
|
||||
vim/.vim/pack/
|
||||
vim/.vim/.swap/*
|
||||
vim/.vim/.backup/*
|
||||
vim/.vim/.undo/*
|
||||
#vim/.vim/pack/
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
[submodule "vim/.vim/pack/default/start/gruvbox"]
|
||||
path = vim/.vim/pack/default/start/gruvbox
|
||||
url = https://github.com/morhetz/gruvbox.git
|
||||
[submodule "vim/.vim/pack/default/start/vim-log-highlighting"]
|
||||
path = vim/.vim/pack/default/start/vim-log-highlighting
|
||||
url = https://github.com/MTDL9/vim-log-highlighting.git
|
||||
[submodule "vim/.vim/pack/default/start/indentLine"]
|
||||
path = vim/.vim/pack/default/start/indentLine
|
||||
url = https://github.com/Yggdroot/indentLine.git
|
||||
[submodule "vim/.vim/pack/default/start/ale"]
|
||||
path = vim/.vim/pack/default/start/ale
|
||||
url = https://github.com/dense-analysis/ale.git
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
compiler go
|
||||
nnoremap <buffer> <space> :silent make <bar> redraw
|
|
@ -0,0 +1,31 @@
|
|||
set tabstop=4 shiftwidth=4 autoindent smartindent expandtab
|
||||
setlocal colorcolumn=80
|
||||
|
||||
setlocal path=.,**
|
||||
setlocal wildignore+=*.pyc
|
||||
|
||||
" Add search in other files inside the path
|
||||
set include=^\\s*\\(from\\\|import\\)\\s*\\zs\\(\\S\\+\\s\\{-}\\)*\\ze\\($\\\|\ as\\)
|
||||
function! PyInclude(fname)
|
||||
" Following examples:
|
||||
" import conv.metrics
|
||||
" /conv.metrics/
|
||||
" conv/metrics.py
|
||||
" from conv import conversion as conv (2)
|
||||
" /conv import conversion/
|
||||
" conv/conversion.py conv.py
|
||||
let parts = split(a:fname, ' import ') " (1) [conv.metrics] (2) [conv, conversion]
|
||||
let l = parts[0] " (1) conv.metrics (2) conv
|
||||
if len ( parts ) > 1
|
||||
let r = parts[1] " conversion
|
||||
let joined = join([l,r], '.') " conv.conversion
|
||||
let fp = substitute(joined, '\.', '/', 'g') . '.py'
|
||||
let found = glob(fp, 1)
|
||||
if len(found)
|
||||
return found
|
||||
endif
|
||||
endif
|
||||
return substitute(joined, '\.', '/', 'g') . '.py'
|
||||
endfunction
|
||||
setlocal includeexpr=PyInclude(v:fname)
|
||||
setlocal define=^\\s*\\<\\(def\\\|class\\)\\>
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 35953042fbf5535a7e905b52a6973c3f7f8a5536
|
|
@ -0,0 +1,3 @@
|
|||
let current_compiler = ‘go’
|
||||
CompilerSet makeprg=go\ build\ ./...
|
||||
CompilerSet errorformat=%E%f:%l:%c:%m
|
|
@ -0,0 +1 @@
|
|||
Subproject commit bf2885a95efdad7bd5e4794dd0213917770d79b7
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 8e2d352eb8958693ea2021f7f43ae0418dcb083b
|
|
@ -0,0 +1,2 @@
|
|||
compiler go
|
||||
nnoremap <buffer> <space> :silent make <bar> redraw
|
|
@ -0,0 +1,31 @@
|
|||
set tabstop=4 shiftwidth=4 autoindent smartindent expandtab
|
||||
setlocal colorcolumn=80
|
||||
|
||||
setlocal path=.,**
|
||||
setlocal wildignore+=*.pyc
|
||||
|
||||
" Add search in other files inside the path
|
||||
set include=^\\s*\\(from\\\|import\\)\\s*\\zs\\(\\S\\+\\s\\{-}\\)*\\ze\\($\\\|\ as\\)
|
||||
function! PyInclude(fname)
|
||||
" Following examples:
|
||||
" import conv.metrics
|
||||
" /conv.metrics/
|
||||
" conv/metrics.py
|
||||
" from conv import conversion as conv (2)
|
||||
" /conv import conversion/
|
||||
" conv/conversion.py conv.py
|
||||
let parts = split(a:fname, ' import ') " (1) [conv.metrics] (2) [conv, conversion]
|
||||
let l = parts[0] " (1) conv.metrics (2) conv
|
||||
if len ( parts ) > 1
|
||||
let r = parts[1] " conversion
|
||||
let joined = join([l,r], '.') " conv.conversion
|
||||
let fp = substitute(joined, '\.', '/', 'g') . '.py'
|
||||
let found = glob(fp, 1)
|
||||
if len(found)
|
||||
return found
|
||||
endif
|
||||
endif
|
||||
return substitute(joined, '\.', '/', 'g') . '.py'
|
||||
endfunction
|
||||
setlocal includeexpr=PyInclude(v:fname)
|
||||
setlocal define=^\\s*\\<\\(def\\\|class\\)\\>
|
|
@ -0,0 +1,3 @@
|
|||
let current_compiler = ‘go’
|
||||
CompilerSet makeprg=go\ build\ ./...
|
||||
CompilerSet errorformat=%E%f:%l:%c:%m
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 8bcbb2995822c4062d00cb41df713fd76092f04f
|
|
@ -0,0 +1 @@
|
|||
Subproject commit d15d63bf9c4a74a02470d4bc8ecce53df13e3a75
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 1037e26f3120e6a6a2c0c33b14a84336dee2a78f
|
110
vim/.vimrc
110
vim/.vimrc
|
@ -1,62 +1,95 @@
|
|||
"set runtimepath^=~/.vim/bundle/ctrlp.vim
|
||||
""set runtimepath^=~/.vim/bundle/nerdtree
|
||||
set nocompatible
|
||||
set backspace=start,eol,indent
|
||||
set hidden
|
||||
set hlsearch
|
||||
syntax on
|
||||
filetype plugin on
|
||||
set tabstop=4 shiftwidth=4 expandtab
|
||||
set number
|
||||
set hlsearch
|
||||
"set relativenumber
|
||||
set tabstop=4 shiftwidth=4 autoindent smartindent expandtab
|
||||
"set noswapfile
|
||||
|
||||
""folding
|
||||
" Numbering of lines
|
||||
" set relativenumber
|
||||
set number
|
||||
|
||||
" Runtimepath variables
|
||||
" call -> set rtp? show the runtime path
|
||||
let $RTP=split(&runtimepath, ',')[0]
|
||||
let $RC="$HOME/.vimrc"
|
||||
|
||||
" Move Swap,Backup and undo files into .vim directory
|
||||
set directory^="$HOME/.vim/.swap//"
|
||||
set backupdir^="$HOME/.vim/.backup//"
|
||||
set undodir^="$HOME/.vim/.undo//"
|
||||
|
||||
" Split to the right and below
|
||||
set splitbelow
|
||||
set splitright
|
||||
|
||||
" Folding
|
||||
set foldenable foldlevelstart=20 foldmethod=indent
|
||||
|
||||
" finding files
|
||||
set path+=**
|
||||
set wildmenu
|
||||
" Rebind shortcut to switch splits
|
||||
nmap <C-h> <C-w>h
|
||||
nmap <C-j> <C-w>j
|
||||
nmap <C-k> <C-w>k
|
||||
nmap <C-l> <C-w>l
|
||||
|
||||
" " tags
|
||||
command! MakeTags !ctags -R .
|
||||
"
|
||||
" linter
|
||||
autocmd FileType python setlocal makeprg=pylint\ --output-format=parseable
|
||||
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 makeprg=yamllint\ --f\ parsable\ %
|
||||
autocmd FileType json autocmd BufWritePre <buffer> %!python -m json.tool 2>/dev/null
|
||||
autocmd BufWritePost *.py silent make! <afile> | silent redraw!
|
||||
autocmd QuickFixCmdPost [^l]* cwindow
|
||||
" Finding files
|
||||
set path+=**
|
||||
set wildmenu
|
||||
|
||||
" file browsing
|
||||
" Tags
|
||||
command! MakeTags !ctags -R .
|
||||
set autochdir
|
||||
set tags=tags;
|
||||
|
||||
" Linter
|
||||
" autocmd FileType python setlocal makeprg=pylint\ --output-format=parseable
|
||||
" autocmd BufWritePost *.py silent make! <afile> | silent redraw!
|
||||
" autocmd QuickFixCmdPost [^l]* cwindow
|
||||
|
||||
" File browsing
|
||||
let g:netrw_banner=0
|
||||
let g:netrw_browse_split=4
|
||||
let g:netrw_altv=1
|
||||
let g:netrw_liststyle=3
|
||||
let g:netrw_list_hide=netrw_gitignore#Hide()
|
||||
let g:netrw_list_hide.=',\(\^\|\s\s\)\zs\.\S\+'
|
||||
"map <C-n> :NERDTreeToggle<CR>
|
||||
map <C-n> :Lex <bar> vertical resize 30 <CR>
|
||||
|
||||
" cursorline
|
||||
" Cursorline
|
||||
set cursorline
|
||||
hi CursorLine cterm=NONE ctermbg=darkgrey ctermfg=white
|
||||
|
||||
" statusline
|
||||
let g:gitparsedbranchname = ' '
|
||||
" Statusline
|
||||
" function! gitbranch()
|
||||
" return system("git rev-parse --abbrev-ref head 2>/dev/null | tr -d '\n'")
|
||||
" endfunction
|
||||
"
|
||||
" function! statuslinegit()
|
||||
" let l:branchname = gitbranch()
|
||||
" return strlen(l:branchname) > 0?' '.l:branchname.' ':''
|
||||
" endfunction
|
||||
function! UpdateGitBranch()
|
||||
let l:branchname = system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
|
||||
let g:branchstatus = strlen(l:branchname) > 0?' '.l:branchname.' ':''
|
||||
let l:branchname = system("git rev-parse --abbrev-ref head 2>/dev/null | tr -d '\n'")
|
||||
let b:branchstatus = strlen(l:branchname) > 0? ' '.l:branchname.' ':''
|
||||
endfunction
|
||||
|
||||
augroup UPDATE_GITBRANCH
|
||||
" clear old commands
|
||||
" clear previous commands
|
||||
autocmd!
|
||||
" update git branch
|
||||
" Update git branch
|
||||
autocmd BufWritePre * :call UpdateGitBranch()
|
||||
autocmd BufReadPost * :call UpdateGitBranch()
|
||||
autocmd BufEnter * :call UpdateGitBranch()
|
||||
augroup END
|
||||
autocmd BufEnter * :call UpdateGitBranch()
|
||||
augroup end
|
||||
|
||||
set laststatus=2
|
||||
set statusline=
|
||||
set statusline+=%#PmenuSel#
|
||||
set statusline+=%{g:branchstatus}
|
||||
" set statusline+=%{StatuslineGit()}
|
||||
set statusline+=%{b:branchstatus}
|
||||
set statusline+=%#BufTabLineCurrent#
|
||||
set statusline+=\ %M
|
||||
set statusline+=\ %r
|
||||
|
@ -70,15 +103,20 @@ set statusline+=\ %c:%l/%L
|
|||
set statusline+=\ %p%%
|
||||
set statusline+=\ [%n]
|
||||
|
||||
packadd! indentLine
|
||||
"let g: indentLine_char = '⦙'
|
||||
|
||||
" Tree of files
|
||||
map <C-n> :Lex <bar> vertical resize 30 <CR>
|
||||
" let g:vimspector_enable_mappings = 'HUMAN'
|
||||
" packadd! vimspector
|
||||
|
||||
"let g:vimspector_enable_mappings = 'HUMAN'
|
||||
"packadd! vimspector
|
||||
|
||||
"packadd! gruvbox
|
||||
packadd! gruvbox
|
||||
colorscheme gruvbox
|
||||
set bg=dark
|
||||
|
||||
packadd! vim-log-highlighting
|
||||
|
||||
packadd! ale
|
||||
packloadall
|
||||
" Load all of the helptags now, after plugins have been loaded.
|
||||
" All messages and errors will be ignored.
|
||||
silent! helptags ALL
|
||||
|
|
Loading…
Reference in New Issue