Compare commits
3 Commits
e94d0ea6f6
...
177d9e8986
Author | SHA1 | Date | |
---|---|---|---|
177d9e8986
|
|||
080f32ea0c
|
|||
26833f2fa9
|
47
vimrc
47
vimrc
@@ -7,6 +7,9 @@ filetype on
|
|||||||
filetype indent on
|
filetype indent on
|
||||||
filetype plugin on
|
filetype plugin on
|
||||||
|
|
||||||
|
let mapleader = ","
|
||||||
|
|
||||||
|
set autowrite
|
||||||
set backspace=indent,eol,start
|
set backspace=indent,eol,start
|
||||||
set backupdir^=~/.vim/_backup//
|
set backupdir^=~/.vim/_backup//
|
||||||
set cursorline
|
set cursorline
|
||||||
@@ -25,6 +28,7 @@ set smartcase
|
|||||||
set statusline+=%#warningmsg#
|
set statusline+=%#warningmsg#
|
||||||
set statusline+=%*
|
set statusline+=%*
|
||||||
set tabstop=4
|
set tabstop=4
|
||||||
|
set updatetime=100
|
||||||
set textwidth=67
|
set textwidth=67
|
||||||
|
|
||||||
if has("persistent_undo")
|
if has("persistent_undo")
|
||||||
@@ -41,17 +45,43 @@ au BufRead,BufNewFile .envrc setfiletype sh
|
|||||||
au BufRead,BufNewFile Dockerfile* setfiletype dockerfile
|
au BufRead,BufNewFile Dockerfile* setfiletype dockerfile
|
||||||
au BufRead,BufNewFile Pipfile setfiletype toml
|
au BufRead,BufNewFile Pipfile setfiletype toml
|
||||||
au BufWritePre *.py execute ':Black'
|
au BufWritePre *.py execute ':Black'
|
||||||
|
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
|
au QuickFixCmdPost *grep* cwindow
|
||||||
|
|
||||||
map ,t :w<CR>
|
" run :GoBuild or :GoTestCompile based on the go file
|
||||||
map ,- :nohl<CR>
|
function! s:build_go_files()
|
||||||
map ,w :%s/ *$//<CR>
|
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>
|
||||||
|
|
||||||
|
map <leader>t :w<CR>
|
||||||
|
map <leader>- :nohl<CR>
|
||||||
|
map <leader>w :%s/ *$//<CR>
|
||||||
|
|
||||||
let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*']
|
let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*']
|
||||||
let g:airline_powerline_fonts = 1
|
let g:airline_powerline_fonts = 1
|
||||||
let g:coc_global_extensions = ['coc-tsserver']
|
let g:coc_global_extensions = ['coc-tsserver']
|
||||||
let g:coc_node_path = "/home/dan/.nvm/versions/node/v16.9.1/bin/node"
|
let g:coc_node_path = "/home/dan/.nvm/versions/node/v16.9.1/bin/node"
|
||||||
|
let g:go_auto_sameids = 1
|
||||||
|
let g:go_auto_type_info = 1
|
||||||
|
let g:go_def_mode='gopls'
|
||||||
let g:go_fmt_command = "goimports"
|
let g:go_fmt_command = "goimports"
|
||||||
|
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'
|
||||||
let g:html_indent_script1 = "inc"
|
let g:html_indent_script1 = "inc"
|
||||||
let g:html_indent_style1 = "inc"
|
let g:html_indent_style1 = "inc"
|
||||||
let g:python_highlight_all = 1
|
let g:python_highlight_all = 1
|
||||||
@@ -65,9 +95,14 @@ let g:vim_markdown_frontmatter = 1
|
|||||||
let g:yapf_style = "pep8"
|
let g:yapf_style = "pep8"
|
||||||
|
|
||||||
if has("python3")
|
if has("python3")
|
||||||
python3 from powerline.vim import setup as powerline_setup
|
python3 << eopython
|
||||||
python3 powerline_setup()
|
try:
|
||||||
python3 del powerline_setup
|
from powerline.vim import setup as powerline_setup
|
||||||
|
powerline_setup()
|
||||||
|
del powerline_setup
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
eopython
|
||||||
endif
|
endif
|
||||||
|
|
||||||
packadd! dracula
|
packadd! dracula
|
||||||
|
10
zshrc
10
zshrc
@@ -41,6 +41,7 @@ path=(
|
|||||||
$HOME/.pyenv/bin
|
$HOME/.pyenv/bin
|
||||||
$HOME/.yarn/bin
|
$HOME/.yarn/bin
|
||||||
$HOME/.pulumi/bin
|
$HOME/.pulumi/bin
|
||||||
|
${KREW_ROOT:-$HOME/.krew}/bin
|
||||||
$HOME/.local/bin
|
$HOME/.local/bin
|
||||||
$HOME/perl5/bin
|
$HOME/perl5/bin
|
||||||
$HOME/Library/Python/3.8/bin
|
$HOME/Library/Python/3.8/bin
|
||||||
@@ -61,6 +62,7 @@ path=(
|
|||||||
plugins=(
|
plugins=(
|
||||||
archlinux
|
archlinux
|
||||||
aws
|
aws
|
||||||
|
brew
|
||||||
bundler
|
bundler
|
||||||
command-not-found
|
command-not-found
|
||||||
cp
|
cp
|
||||||
@@ -97,6 +99,10 @@ plugins=(
|
|||||||
yarn
|
yarn
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if [[ -x /home/linuxbrew/.linuxbrew/bin/brew ]]; then
|
||||||
|
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -d ~/.oh-my-zsh/plugins/just/ ]]; then
|
if [[ -d ~/.oh-my-zsh/plugins/just/ ]]; then
|
||||||
plugins+=just
|
plugins+=just
|
||||||
fi
|
fi
|
||||||
@@ -158,7 +164,7 @@ if [[ -f ~/.cargo/env ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if gimme --version &>/dev/null; then
|
if gimme --version &>/dev/null; then
|
||||||
eval "$(gimme '1.17.5')" 2>/dev/null
|
eval "$(gimme '1.18.x')" 2>/dev/null
|
||||||
export GOPATH="$HOME/go"
|
export GOPATH="$HOME/go"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -226,7 +232,7 @@ if [[ -d /usr/local/opt/python@3.8/lib/pkgconfig ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if nvm &>/dev/null; then
|
if nvm &>/dev/null; then
|
||||||
nvm use --delete-prefix lts/erbium --silent
|
nvm use --delete-prefix 16 --silent
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if kitty --version &>/dev/null; then
|
if kitty --version &>/dev/null; then
|
||||||
|
Reference in New Issue
Block a user