Skip to content

Commit

Permalink
yikes: a lot of small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kovetskiy committed Sep 3, 2020
1 parent 60ea484 commit bd2c218
Show file tree
Hide file tree
Showing 15 changed files with 114 additions and 47 deletions.
9 changes: 5 additions & 4 deletions .config/coc/extensions/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"dependencies": {
"coc-css": ">=1.2.4",
"coc-git": ">=1.7.13",
"coc-go": ">=0.7.0",
"coc-git": ">=1.8.3",
"coc-go": ">=0.10.0",
"coc-highlight": ">=1.2.5",
"coc-java": ">=1.4.11",
"coc-java-lombok": ">=1.0.0",
"coc-json": ">=1.2.6",
"coc-pairs": ">=1.2.21",
"coc-python": ">=1.2.12",
"coc-tsserver": ">=1.5.1",
"coc-xml": ">=1.11.1"
"coc-tabnine": ">=1.2.2",
"coc-tsserver": ">=1.5.4",
"coc-xml": ">=1.12.0"
}
}
2 changes: 1 addition & 1 deletion .gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@
[diff "image"]
command = /home/operator/dotfiles/git-diff-image/git_diff_image
[diff]
tool = vimdiff2
tool = vimdiff
24 changes: 22 additions & 2 deletions .vim/coc-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"diagnostic.infoSign": "\\",
"java.home": "/usr/lib/jvm/java-8-openjdk/",
"java.import.gradle.enabled": false,
"java.autobuild.enabled": true,
"xml.validation.enabled": false,
"xml.validation.schema": false,
"xml.validation.noGrammar": "ignore",
Expand All @@ -22,7 +23,7 @@
"git.changedSign.hlGroup": "GitModified",
"git.changeRemovedSign.text": "\\",
"git.changeRemovedSign.hlGroup": "GitModified",
"typescript.preferences.importModuleSpecifier": "non-relative",
"typescript.preferences.importModuleSpecifier": "non-relative",
"javascript.preferences.importModuleSpecifier": "non-relative",
"languageserver": {
"terraform": {
Expand Down Expand Up @@ -147,5 +148,24 @@
"`"
],
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true,
"coc.preferences.hoverTarget": "preview"
"coc.preferences.hoverTarget": "preview",
"go.trace.server": "verbose",
"go.goplsOptions": {
"codelens": {
"generate": true,
"test": true,
"gc_details": true,
"upgrade.dependency": true
},
"usePlaceholders": true,
"analyses": {
"fillreturns": true,
"nonewvars": true,
"unusedparams": true,
"undeclaredname": true
},
"hoverKind": "FullDocumentation"
},
"go.goplsPath": "/home/operator/go/bin/gopls",
"java.jdt.ls.vmargs": "-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication -javaagent:\"/home/operator/.config/coc/extensions/node_modules/coc-java-lombok/jar/lombok.jar\""
}
1 change: 1 addition & 0 deletions bin/volume
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
local status="$(:change "$action")"

:notify "$status"
echo "$status"
}

:notify() {
Expand Down
2 changes: 2 additions & 0 deletions vim.d/00-base.vim
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,5 @@ if has('nvim')
else
set viminfo+=n~/.vim/runtime/viminfo
endif

let @/ = ''
3 changes: 1 addition & 2 deletions vim.d/01-plugins.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Plug 'itchyny/lightline.vim'
Plug 'scrooloose/nerdcommenter'
Plug 'kovetskiy/vim-hacks'
Plug 'kovetskiy/synta'
Plug 'fatih/vim-go', {'for': ['go', 'yaml', 'template']}
"Plug 'fatih/vim-go', {'for': ['go', 'yaml', 'template']}
Plug 'vim-scripts/l9'
Plug 'sirver/ultisnips', { 'frozen': 1 }
Plug 'tpope/vim-surround'
Expand Down Expand Up @@ -88,7 +88,6 @@ Plug 'hashivim/vim-terraform', {'for': 'terraform'}
let g:terraform_align=1
let g:terraform_fmt_on_save=1
Plug 'ddrscott/vim-side-search'
Plug 'matze/vim-move'
Plug 'kovetskiy/neovim-move', { 'do' : ':UpdateRemotePlugins' }

Plug 'rhysd/vim-grammarous'
Expand Down
2 changes: 2 additions & 0 deletions vim.d/02-colors.vim
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ if $BACKGROUND == "dark"
hi! GitAdded ctermfg=NONE ctermbg=NONE guibg=NONE guifg=#2aa198 gui=bold
hi! GitModified ctermfg=NONE ctermbg=NONE guibg=NONE guifg=#6c71c4 gui=bold
"hi! ColorColumn ctermbg=NONE guibg=#e6e6e6 guifg=NONE ctermfg=NONE

hi! CocCursorRange guibg=#b16286 guifg=#ebdbb2 ctermbg=5 ctermfg=3
endfunc!
endif

Expand Down
2 changes: 1 addition & 1 deletion vim.d/32-misc-func.vim
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endfunc!
" _close_it closes current window, but if current buffer is opened in two
" windows then only current window will be closed, desu
func! _close_it()
py <<CODE
py3 <<CODE
import vim

buffer = vim.current.buffer
Expand Down
15 changes: 12 additions & 3 deletions vim.d/40-coc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,23 @@ nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gl :call CocActionAsync('jumpDefinition', 'vsplit')<CR>
nmap <silent> gk :call CocActionAsync('jumpDefinition', 'split')<CR>
nmap <leader>rn <Plug>(coc-rename)
nmap <leader>ca <Plug>(coc-codeaction)
xmap if <Plug>(coc-funcobj-i)
omap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap af <Plug>(coc-funcobj-a)
xmap ic <Plug>(coc-classobj-i)
omap ic <Plug>(coc-classobj-i)
xmap ac <Plug>(coc-classobj-a)
omap ac <Plug>(coc-classobj-a)
nmap <C-F> <NOP>
nmap <leader>f <Plug>(coc-format)
vmap <leader>f <Plug>(coc-format-selected)
augroup _coc_highlight
au!
au VimEnter,BufRead * hi! CocErrorHighlight ctermbg=52 ctermfg=none cterm=none
au VimEnter,BufRead * hi! CocListBgRed ctermbg=52 ctermfg=none cterm=none
au VimEnter,BufRead * hi! SpellBad ctermbg=52 ctermfg=none cterm=none
au VimEnter,BufRead * hi! CocErrorHighlight ctermbg=52 ctermfg=NONE cterm=NONE
au VimEnter,BufRead * hi! CocListBgRed ctermbg=52 ctermfg=NONE cterm=NONE
au VimEnter,BufRead * hi! SpellBad ctermbg=52 ctermfg=NONE cterm=NONE
augroup end
35 changes: 32 additions & 3 deletions vim.d/45-visual-multi.vim
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
let g:VM_custom_remaps = {'<c-p>': '[', '<c-s>': 'q'}
let g:VM_silent_exit = 1
let g:VM_quit_after_leaving_insert_mode = 1
let g:VM_highlight_matches = 'hi Search guibg=#FFDD40 guifg=#543E5B'

let g:VM_disable_syntax_in_imode = 1
let g:VM_no_meta_mappings = 1
let g:VM_maps = {
\ 'Select All': '<C-A>',
Expand All @@ -7,20 +11,45 @@ let g:VM_maps = {

let g:VM_leader = "\\"

fun! VM_before_auto()
fun! VM_Start()
unmap f
unmap F
unmap t
unmap T
unmap ,
unmap ;

call pythonx#unmap_autoimport()
endfun

fun! VM_after_auto()
fun! VM_Exit()
map f <Plug>Sneak_f
map F <Plug>Sneak_F
map t <Plug>Sneak_t
map T <Plug>Sneak_T
map , <Plug>Sneak_,
map ; <Plug>Sneak_;
call pythonx#map_autoimport()
endfun

function! s:SelectAllMark()
exec 'VMSearch'.msearch#joint_pattern()
call feedkeys("\<Plug>(VM-Select-All)")
call feedkeys("\<Plug>(VM-Goto-Prev)")
endfunction

function! s:VSelectAllMark()
let [line_start, column_start] = getpos("'<")[1:2]
let [line_end, column_end] = getpos("'>")[1:2]
exec line_start.','.line_end-1.' VMSearch '.msearch#joint_pattern()
endfunction

function! s:VSelectAllMark()
let [line_start, column_start] = getpos("'<")[1:2]
let [line_end, column_end] = getpos("'>")[1:2]
exec line_start.','.line_end.' VMSearch '.msearch#joint_pattern()
endfunction

nnoremap <leader>a :call <sid>SelectAllMark()<cr>
vnoremap <leader>a :<c-u>call <sid>VSelectAllMark()<cr>
9 changes: 9 additions & 0 deletions vim.d/50-snippets.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ func! _snippets_stop()
python "UltiSnips_Manager._leave_buffer()"
endfunc!

func! _snippets_fix()
py3 import importlib; import UltiSnips.snippet_manager; importlib.reload(UltiSnips.snippet_manager); from UltiSnips.snippet_manager import UltiSnips_Manager;
endfunc!

augroup _ultisnips_fix_expand
au!
au WinEnter * call _snippets_fix()
augroup end

func! _snippets_get_filetype()
let l:dot = strridx(&filetype, ".")
if l:dot != -1
Expand Down
3 changes: 0 additions & 3 deletions vim.d/61-langs-java.vim
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ augroup _code_java
au BufRead,BufNewFile *.java
\ call ale#Set('java_google_java_format_options',
\ '--skip-removing-unused-imports --skip-sorting-imports')
au FileType go
\ call ale#Set('go_goimports_executable',
\ 'gofumports')

au FileType java nmap <silent><buffer> <c-a> :ALEFix<CR>
au FileType java nmap <silent><buffer> <c-s> :call _save_java()<CR>
Expand Down
6 changes: 4 additions & 2 deletions vim.d/62-langs-javascript.vim
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
augroup _code_typescript
au!

au BufRead,BufNewFile *.ts
au BufRead,BufNewFile *.ts,*.js
\ call ale#Set('typescript_gts_executable',
\ 'npx')
au BufRead,BufNewFile *.ts
au BufRead,BufNewFile *.ts,*.js
\ call ale#Set('typescript_gts_options',
\ 'gts fix')

Expand Down Expand Up @@ -37,3 +37,5 @@ function! _ale_gts_fixer(buffer) abort
endfunction

let g:ale_fixers['typescript'] = [function('_ale_gts_fixer')]
let g:ale_fixers['javascript'] = ['prettier', 'eslint']
let g:ale_fixers['json'] = ['fixjson']
42 changes: 20 additions & 22 deletions vim.d/63-langs-go.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ augroup _code_go
au!

au FileType go,go2 nmap <buffer><silent> <C-Q> :call _goto_prev_func()<CR>
au FileType go,go2 let w:go_stack = 'fix that shit'
au FileType go,go2 let w:go_stack_level = 'fix that shit'
au FileType go,go2 nmap <silent><buffer> gt :call go#def#Jump('', 1)<CR>
au FileType go,go2 nmap <silent><buffer> gd :call go#def#Jump('', 0)<CR>
au FileType go,go2 nmap <silent><buffer> gl :call go#def#Jump('vsplit', 0)<CR>
au FileType go,go2 nmap <silent><buffer> gk :call go#def#Jump('split', 0)<CR>
au FileType go,go2 nmap <silent><buffer> <c-p> :w<CR>:call synta#go#build()<CR>
au FileType go,go2 imap <silent><buffer> <c-p> <ESC>:w<CR>:call synta#go#build()<CR>
au FileType go,go2 nnoremap <buffer> <Leader>r :call CocActionAsync('rename')<CR>
Expand All @@ -26,6 +20,10 @@ augroup _code_go

au BufEnter *.template call _extend_templatego()
au BufEnter *.yaml call _extend_yaml()

au FileType go
\ call ale#Set('go_goimports_executable',
\ 'gofumports')
augroup end

func! _goto_prev_func()
Expand Down Expand Up @@ -102,24 +100,24 @@ endfunc!
let g:ale_fixers['go'] = [function("synta#ale#goimports#Fix"), function("synta#ale#goinstall#Fix")]
let g:ale_fixers['go2'] = ['gofmt']
let g:ale_linters = {'go': ['gobuild']}

"let g:ale_linters = {'go2': ['']}

let g:go_template_autocreate = 0

let g:go_fmt_fail_silently = 0
let g:go_fmt_command = "gofumports"
let g:go_fmt_autosave = 0
let g:go_bin_path = $GOPATH . "/bin"
let g:go_metalinter_command="golangci-lint run"
let g:go_list_type = "quickfix"
let g:go_auto_type_info = 0
let g:go_gocode_autobuild = 1

let g:go_doc_keywordprg_enabled = 0
let g:go_def_mapping_enabled = 0
let g:go_def_mode = 'godef'
let g:go_info_mode = 'gopls'
let g:go_rename_command = 'gopls'
"let g:go_template_autocreate = 0

"let g:go_fmt_fail_silently = 0
"let g:go_fmt_command = "gofumports"
"let g:go_fmt_autosave = 0
"let g:go_bin_path = $GOPATH . "/bin"
"let g:go_metalinter_command="golangci-lint run"
"let g:go_list_type = "quickfix"
"let g:go_auto_type_info = 0
"let g:go_gocode_autobuild = 1

"let g:go_doc_keywordprg_enabled = 0
"let g:go_def_mapping_enabled = 0
"let g:go_def_mode = 'godef'
"let g:go_rename_command = 'gopls'

let g:synta_go_highlight_calls = 0
let g:synta_go_highlight_calls_funcs = 1
Expand Down
6 changes: 2 additions & 4 deletions vim.d/90-map.vim
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ imap <C-D> context.
nnoremap <C-E><C-E> :cd %:p:h<CR>
nnoremap <C-E><C-R> :call _cd_root()<CR>
nnoremap <Leader>o o<ESC>
nnoremap <Leader>O O<ESC>
nnoremap X S<ESC>
vnoremap $ g_
Expand Down Expand Up @@ -144,8 +141,9 @@ nnoremap <silent> <Leader>k :call AddEmptyLineAbove()<CR>
nmap <leader>m :Move<space>
nmap <leader>s :call _sidesearch()<CR>
nmap <leader>a :SideSearch<Space>
nnoremap gf :call _goto_file()<CR>
cnoremap <c-_> .*
vmap ) S)i

0 comments on commit bd2c218

Please sign in to comment.