CoC will now be the main plugin for autocompletion

This commit is contained in:
Sebastian 2021-09-16 07:54:28 +02:00
parent 8f6ecbf802
commit a7d59616fe
3 changed files with 93 additions and 12 deletions

View file

@ -1,7 +1,7 @@
apt-get update
apt-get upgrade
apt-get install python3 vim-nox tmux nano zsh git autossh mosh sshuttle fail2ban avahi-daemon ufw lynx npm apticron tidy nmon python-pip python3-pip
apt-get install python3 vim-nox tmux nano zsh git autossh mosh sshuttle fail2ban avahi-daemon ufw lynx npm apticron tidy nmon python-pip python3-pip printer-driver-gutenprint htop
ufw allow ssh

50
dotfiles/.eslintrc.json Normal file
View file

@ -0,0 +1,50 @@
{
"extends": "eslint:recommended",
"env": {
"node": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 2021
},
"rules": {
"arrow-spacing": ["warn", { "before": true, "after": true }],
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"comma-dangle": ["error", "always-multiline"],
"comma-spacing": "error",
"comma-style": "error",
"curly": ["error", "multi-line", "consistent"],
"dot-location": ["error", "property"],
"handle-callback-err": "off",
"indent": ["error", 4],
"keyword-spacing": "error",
"max-nested-callbacks": ["error", { "max": 4 }],
"max-statements-per-line": ["error", { "max": 2 }],
"no-console": "off",
"no-empty-function": "error",
"no-floating-decimal": "error",
"no-inline-comments": "error",
"no-lonely-if": "error",
"no-multi-spaces": "error",
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1, "maxBOF": 0 }],
"no-shadow": ["error", { "allow": ["err", "resolve", "reject"] }],
"no-trailing-spaces": ["error"],
"no-var": "error",
"object-curly-spacing": ["error", "always"],
"prefer-const": "error",
"quotes": ["error", "double"],
"semi": ["error", "never"],
"space-before-blocks": "error",
"space-before-function-paren": ["error", {
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
}],
"space-in-parens": "error",
"space-infix-ops": "error",
"space-unary-ops": "error",
"spaced-comment": "error",
"yoda": "error"
}
}

View file

@ -18,20 +18,20 @@ call plug#begin('~/.vim/bundle')
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']}
" Add git changes to front of the line
Plug 'airblade/vim-gitgutter'
" Java autocomplete
Plug 'artur-shaik/vim-javacomplete2'
" Plug 'artur-shaik/vim-javacomplete2'
" Generates a list of todo comments
Plug 'chauncey-garrett/vim-tasklist'
" Autocompletion for everything
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" Fuzzy file finder
Plug 'ctrlpvim/ctrlp.vim'
" I need this for python
Plug 'davidhalter/jedi-vim'
" Zooms into windows (fullscreen toggle)
Plug 'szw/vim-maximizer'
" Linter and analyse tool
Plug 'dense-analysis/ale'
@ -264,7 +264,7 @@ let g:user_emmet_leader_key=','
let g:user_emmet_settings = webapi#json#decode(join(readfile(expand('~/.vim/customizations/vim-emmet-mysnippets.json')), "\n"))
" jedi-vim:
let g:jedi#popup_on_dot = 1
"let g:jedi#popup_on_dot = 1
" Peekaboo window width
let g:peekaboo_window = 'vert bo 65new'
@ -275,16 +275,23 @@ autocmd FileType java setlocal omnifunc=javacomplete#Complete
" tasklist settings
let g:tlTokenList = ["FIXME", "TODO", "todo"] " keywords for todos
let g:tlWindowPosition = 1 "Open window on bottom, 0 would be top
let g:tlRememberPosition = 0
let g:tlRememberPosition = 1
map <leader>t <Plug>TaskList
" nerdtree settings
map <C-n> :NERDTreeToggle<CR>
let NERDTreeIgnore=['\.git$']
let NERDTreeIgnore=["\.git$"]
" nerdcommenter settins
let g:NERDCompactSexyComs = 1
let g:NERDDefaultAlign = 'left'
" Comment symbols are in a straight line and not mimicing the indents of the code
let g:NERDDefaultAlign = "left"
" Add a space between the comment symbol(s) and the code
let NERDSpaceDelims=1
" supertab settings
" On autocomplete, start cycling from top to bottom
let g:SuperTabDefaultCompletionType = "<c-n>"
" airline settings
let g:airline#extensions#tabline#enabled = 1 " Show buffers as tabs
@ -294,6 +301,7 @@ let g:ale_linters = {'python': ['flake8', 'mypy', 'pylint', 'prospector']}
let g:ale_fixers = {'python': ['isort', 'black'],
\'json': ['fixjson'],
\'html': ['html-beautify', 'tidy'],
\'htmldjango': ['html-beautify'],
\'xml': ['xmllint'],
\'java': ['uncrustify'],
\'javascript': ['prettier', 'xo', 'standard', 'eslint'],
@ -359,6 +367,20 @@ set undofile
" Set the character which is used as tab indent marker
let g:indentLine_char = '┊'
" CoC install the language extensions I want:
let g:coc_global_extensions = [
\"coc-json",
\"coc-git",
\"coc-tsserver",
\"coc-html",
\"coc-css",
\"coc-htmldjango",
\"coc-jedi",
\"coc-vetur"]
" Toggle zoom into windows with vim-maximizer
nnoremap <leader>z :MaximizerToggle<CR>
" In split views, delete a buffer but keep the window layout.
" Found it here: https://vim.fandom.com/wiki/Deleting_a_buffer_without_closing_the_window
@ -434,6 +456,15 @@ nnoremap <silent> <Plug>Kwbd :<C-u>Kwbd<CR>
nmap <leader>bd <Plug>Kwbd
nmap <silent> ga <Plug>(coc-codeaction-line)
" Go to definition
nmap <silent> <leader>g <Plug>(coc-definition)
" nmap <silent> gy <Plug>(coc-type-definition)
" nmap <silent> gi <Plug>(coc-implementation)
" nmap <silent> gr <Plug>(coc-references)
" Load local config if there is one
if filereadable($HOME . "/.vimrc.local")
source ~/.vimrc.local