2021-01-04 17:43:49 +00:00
|
|
|
packloadall
|
|
|
|
call pathogen#infect()
|
|
|
|
|
2014-09-25 03:42:16 +00:00
|
|
|
syntax on
|
|
|
|
|
|
|
|
filetype on
|
|
|
|
filetype indent on
|
|
|
|
filetype plugin on
|
|
|
|
|
2022-04-28 20:21:59 +00:00
|
|
|
let mapleader = ","
|
|
|
|
|
|
|
|
set autowrite
|
2014-10-01 02:23:54 +00:00
|
|
|
set backspace=indent,eol,start
|
2017-08-17 20:31:30 +00:00
|
|
|
set backupdir^=~/.vim/_backup//
|
|
|
|
set cursorline
|
|
|
|
set cursorcolumn
|
2014-09-25 03:42:16 +00:00
|
|
|
set directory^=~/.vim/_temp//
|
2017-08-27 14:07:51 +00:00
|
|
|
set encoding=utf8
|
2014-09-25 03:42:16 +00:00
|
|
|
set hlsearch
|
|
|
|
set ignorecase
|
|
|
|
set incsearch
|
|
|
|
set laststatus=2
|
2018-08-17 13:02:13 +00:00
|
|
|
set linebreak
|
2019-03-07 16:04:17 +00:00
|
|
|
set modeline
|
2014-09-25 03:42:16 +00:00
|
|
|
set nowrap
|
|
|
|
set number
|
|
|
|
set smartcase
|
2021-01-04 17:43:49 +00:00
|
|
|
set statusline+=%#warningmsg#
|
|
|
|
set statusline+=%*
|
2014-09-25 03:42:16 +00:00
|
|
|
set tabstop=4
|
2022-04-28 20:21:59 +00:00
|
|
|
set updatetime=100
|
2014-09-25 03:42:16 +00:00
|
|
|
set textwidth=67
|
|
|
|
|
2020-03-26 13:48:30 +00:00
|
|
|
if has("persistent_undo")
|
|
|
|
set undodir=~/.vim/_undo//
|
|
|
|
set undofile
|
|
|
|
endif
|
|
|
|
|
2019-04-09 14:04:26 +00:00
|
|
|
au BufRead,BufNewFile *.gcfg setfiletype gitconfig
|
2022-01-15 22:18:38 +00:00
|
|
|
au BufRead,BufNewFile *.hcl setfiletype hcl
|
|
|
|
au BufRead,BufNewFile *.nomad setfiletype hcl
|
2020-08-17 02:28:41 +00:00
|
|
|
au BufRead,BufNewFile *.service setfiletype systemd
|
2021-01-04 17:43:49 +00:00
|
|
|
au BufRead,BufNewFile .Rprofile setfiletype r
|
2022-04-28 20:21:59 +00:00
|
|
|
au BufRead,BufNewFile .envrc setfiletype sh
|
|
|
|
au BufRead,BufNewFile Dockerfile* setfiletype dockerfile
|
|
|
|
au BufRead,BufNewFile Pipfile setfiletype toml
|
2022-11-18 17:06:54 +00:00
|
|
|
au BufRead,BufNewFile kubectl-edit-status-* setfiletype yaml
|
2022-04-28 20:21:59 +00:00
|
|
|
au BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4
|
|
|
|
au FileType go nmap <leader>r <Plug>(go-run)
|
|
|
|
au FileType go nmap <Leader>c <Plug>(go-coverage-toggle)
|
|
|
|
au QuickFixCmdPost *grep* cwindow
|
|
|
|
|
|
|
|
" run :GoBuild or :GoTestCompile based on the go file
|
|
|
|
function! s:build_go_files()
|
|
|
|
let l:file = expand('%')
|
|
|
|
if l:file =~# '^\f\+_test\.go$'
|
|
|
|
call go#test#Test(0, 1)
|
|
|
|
elseif l:file =~# '^\f\+\.go$'
|
|
|
|
call go#cmd#Build(0)
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
au FileType go nmap <leader>b :<C-u>call <SID>build_go_files()<CR>
|
|
|
|
au FileType go nmap <leader>d :GoDef<CR>
|
2022-10-27 14:12:21 +00:00
|
|
|
au FileType go nmap <leader>N :GoRename<CR>
|
2022-06-30 13:54:29 +00:00
|
|
|
au FileType go nmap <leader>R :GoReferrers<CR>
|
2019-04-09 14:04:26 +00:00
|
|
|
|
2022-04-28 20:21:59 +00:00
|
|
|
map <leader>t :w<CR>
|
|
|
|
map <leader>- :nohl<CR>
|
|
|
|
map <leader>w :%s/ *$//<CR>
|
2014-09-25 03:42:16 +00:00
|
|
|
|
2023-01-10 16:46:55 +00:00
|
|
|
au FileType python nmap <leader>t :Black<CR>:w<CR>
|
|
|
|
|
2021-05-09 16:30:02 +00:00
|
|
|
let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*']
|
2017-08-27 14:07:51 +00:00
|
|
|
let g:airline_powerline_fonts = 1
|
2022-01-03 15:23:57 +00:00
|
|
|
let g:coc_global_extensions = ['coc-tsserver']
|
|
|
|
let g:coc_node_path = "/home/dan/.nvm/versions/node/v16.9.1/bin/node"
|
2022-04-28 20:21:59 +00:00
|
|
|
let g:go_auto_sameids = 1
|
|
|
|
let g:go_auto_type_info = 1
|
|
|
|
let g:go_def_mode='gopls'
|
2018-08-17 13:02:13 +00:00
|
|
|
let g:go_fmt_command = "goimports"
|
2022-04-28 20:21:59 +00:00
|
|
|
let g:go_highlight_build_constraints = 1
|
|
|
|
let g:go_highlight_extra_types = 1
|
|
|
|
let g:go_highlight_fields = 1
|
|
|
|
let g:go_highlight_function_calls = 1
|
|
|
|
let g:go_highlight_functions = 1
|
|
|
|
let g:go_highlight_operators = 1
|
|
|
|
let g:go_info_mode='gopls'
|
2022-01-15 22:18:38 +00:00
|
|
|
let g:html_indent_script1 = "inc"
|
|
|
|
let g:html_indent_style1 = "inc"
|
2018-08-17 13:02:13 +00:00
|
|
|
let g:python_highlight_all = 1
|
2018-03-24 02:17:25 +00:00
|
|
|
let g:rustfmt_autosave = 1
|
2020-03-08 04:30:26 +00:00
|
|
|
let g:shfmt_extra_args = '-i 2'
|
|
|
|
let g:shfmt_fmt_on_save = 1
|
2018-03-24 02:17:25 +00:00
|
|
|
let g:terraform_align = 1
|
|
|
|
let g:terraform_fmt_on_save = 1
|
2018-08-17 13:02:13 +00:00
|
|
|
let g:vim_markdown_folding_disabled = 1
|
|
|
|
let g:vim_markdown_frontmatter = 1
|
2018-12-29 21:40:11 +00:00
|
|
|
let g:yapf_style = "pep8"
|
2014-11-12 16:00:11 +00:00
|
|
|
|
2020-10-27 14:00:46 +00:00
|
|
|
packadd! dracula
|
|
|
|
colorscheme dracula
|
2021-01-04 17:43:49 +00:00
|
|
|
|
2020-03-26 13:48:30 +00:00
|
|
|
hi Comment cterm=NONE ctermfg=DarkRed gui=NONE guifg=red2
|
2021-07-07 14:02:22 +00:00
|
|
|
|
|
|
|
nmap <leader>sp :call <SID>SynStack()<CR>
|
|
|
|
function! <SID>SynStack()
|
|
|
|
if !exists("*synstack")
|
|
|
|
return
|
|
|
|
endif
|
|
|
|
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
|
|
|
|
endfunc
|