diff options
author | Matthew Lemon <y@yulqen.org> | 2023-08-11 09:19:12 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2023-08-11 09:19:12 +0100 |
commit | 39c92fea8b9e96b2756d94b285dae8cfb015d68f (patch) | |
tree | 0584dde0c6e04577edd2e8d027726240900086c5 | |
parent | d3ae449a1f13c8a017fea6dd27febca2eb4a03db (diff) |
Adds back YCM, Ale vim-tailwind and a few other tweaks
-rw-r--r-- | vim/vimrc | 82 |
1 files changed, 80 insertions, 2 deletions
@@ -1,6 +1,6 @@ -syntax on filetype plugin on filetype indent on +syntax on " leader let maplocalleader = "\\" @@ -100,6 +100,8 @@ call plug#begin() "Plug 'vim-scripts/AutoComplPop' Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } Plug 'junegunn/fzf.vim' +Plug 'ycm-core/YouCompleteMe' +Plug 'airblade/vim-tailwind' Plug 'lambdalisue/fern.vim' Plug 'junegunn/goyo.vim' Plug 'sheerun/vim-polyglot' @@ -115,8 +117,84 @@ Plug 'tpope/vim-unimpaired' Plug 'tpope/vim-fugitive' Plug 'SirVer/UltiSnips' Plug 'honza/vim-snippets' +Plug 'dense-analysis/ale' call plug#end() +" vim-tailwind +function! s:is_tailwind() + return !empty(findfile('tailwind.config.js', '.;')) || + \ !empty(findfile('theme/static_src/tailwind.config.js', '.;')) +endfunction + +nmap <silent> <buffer> gk <Plug>(tailwind-lookup) + +autocmd BufEnter *.html,*.slim if s:is_tailwind() | + \ setlocal omnifunc=tailwind#Complete | + \ endif + +" YCM +let g:ycm_enable_inlay_hints = 1 +nnoremap <silent> <localleader>h <Plug>(YCMToggleInlayHints) +nnoremap gd :YcmCompleter GoToDefinition<CR> +nnoremap <leader>gr :YcmCompleter GoToReferences<CR> +nnoremap K :YcmCompleter GetDoc<CR> +" this will disable tab, allowing it to be used for ultisnips +let g:ycm_key_list_select_completion = ['<C-n>', '<Down>'] +let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>'] +let g:ycm_python_interpreter_path = '.venv/bin/python3' +let g:ycm_auto_trigger = 0 +let g:ycm_python_sys_path = [] +let g:ycm_show_diagnostics_ui = 1 +let g:ycm_extra_conf_vim_data = [ + \ 'g:ycm_python_interpreter_path', + \ 'g:ycm_python_sys_path' + \] +"let g:ycm_global_ycm_extra_conf = '~/.global_extra_conf.py' +nnoremap <leader>jd :YcmCompleter GoTo<CR> +imap <silent> <C-l> <Plug>(YCMToggleSignatureHelp)'. + + +let g:ycm_enable_inlay_hints = 1 + +" ALE ale config +let g:ale_enabled = 1 +let g:ale_echo_msg_format = '[%linter%] %s [%severity%]' +let g:ale_sign_error = '✘' +let g:ale_sign_warning = '⚠' +let g:ale_lint_on_text_changed = 0 +let g:ale_hover_cursor = 0 +let g:ale_virtualtext_cursor = 'disabled' +let g:ale_sign_column_always = 1 +let g:ale_open_list = 0 +let g:ale_set_highlights = 1 +let g:ale_set_signs = 1 +let g:ale_set_loclist = 1 +let g:ale_set_quickfix = 0 +let g:ale_echo_cursor = 1 +let g:ale_echo_msg_error_str = 'Error' +let g:ale_echo_msg_format = '%linter% - %code: %%s' +let g:ale_loclist_msg_format = '%linter% - %code: %%s' +let g:ale_echo_msg_warning_str = 'Warning' +let g:ale_linters = {'python': ['pyright', 'flake8', 'mypy'], +\ 'ocaml': ['merlin'], +\ 'cpp': ['clang'], +\ 'yaml': ['yamllint'], +\ 'c': ['clang'], +\ 'go': ['gopls', 'golint', 'gofmt'], + \} +let g:ale_fixers = { +\ 'python': ['autoimport', 'isort', 'yapf', 'black'], +\ 'go': ['gofmt'], +\ 'rust': ['rustfmt'] +\ } +let g:ale_python_mypy_ignore_invalid_syntax = 1 +let g:ale_python_mypy_executable = 'mypy' +let g:ale_python_mypy_options = '--config-file mypy.ini' +" let g:ale_sign_error = '>>' +let g:ale_fix_on_save = 1 +let g:ale_linters_explicit = 0 +set omnifunc=ale#completion#OmniFunc + " Make :grep use ripgrep if executable('rg') set grepprg=rg\ --color=never\ --vimgrep @@ -158,7 +236,7 @@ nmap <silent> ts :TestSuite<CR> nmap <silent> tl :TestLast<CR> nmap <silent> <leader>tv :TestVisit<CR> let test#strategy = "basic" -let test#python#pytest#options = '-q -s' +let test#python#pytest#options = '-q -s -n2' let test#python#runner = 'pytest' let test#vimterminal#term_position = "belowright" |