Compare commits

..

5 Commits

Author SHA1 Message Date
Wouter Gordts 2700c07cc1 log overdue commit 2024-01-30 09:10:33 +01:00
waldek 26caf09948 includes vimspector 2022-06-26 12:09:35 +02:00
waldek 7973bf32b3 Merge branch 'master' of ssh://86thumbs.net:3022/waldek/vimrc 2022-05-24 17:18:07 +02:00
waldek afb046ece3 laptop changes 2022-05-24 17:14:33 +02:00
waldek f0b2f87537 minor markdown updates 2022-05-24 17:12:53 +02:00
5 changed files with 127 additions and 14 deletions

View File

@ -54,6 +54,8 @@ set autowriteall
set sw=4
set ts=4
set sts=4
set autoindent
set expandtab
" mouse usage can be handy, especially when using LspPeekDefinition
set mouse=a

View File

@ -5,6 +5,8 @@
" set a colorscheme
silent! colorscheme solarized
set background=dark
highlight Normal ctermbg=black
hi Normal guibg=NONE ctermbg=NONE
" do soft wrap of text but not in the middle of words
set wrap linebreak nolist

View File

@ -19,12 +19,14 @@ Plugin 'preservim/nerdtree'
Plugin 'jeetsukumaran/vim-buffergator'
" IDE like plugins
Plugin 'prabirshrestha/asyncomplete.vim'
Plugin 'prabirshrestha/vim-lsp'
Plugin 'prabirshrestha/asyncomplete.vim'
Plugin 'prabirshrestha/asyncomplete-lsp.vim'
Plugin 'mattn/vim-lsp-settings'
"Plugin 'yami-beta/asyncomplete-omni.vim'
Plugin 'prabirshrestha/asyncomplete-file.vim'
Plugin 'dense-analysis/ale'
Plugin 'rhysd/vim-lsp-ale'
" Language autocomplete for English
Plugin 'htlsne/asyncomplete-look'
@ -32,6 +34,11 @@ Plugin 'htlsne/asyncomplete-look'
" an additional colorscheme I like
Plugin 'altercation/vim-colors-solarized'
" a nice statusbar
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
" no load my personal plugins
let _plugins_list = _vimrc_dir . "/" . $USER . "_plugins.list"
if filereadable(_plugins_list)
"echomsg "found user plugins " . _plugins_list
@ -66,7 +73,7 @@ autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTr
" the definition of a function or class
function! s:on_lsp_buffer_enabled() abort
setlocal omnifunc=lsp#complete
setlocal signcolumn=no " messes with some autocomplete!
"setlocal signcolumn=no " messes with some autocomplete!
if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif
nmap <buffer> gd <plug>(lsp-definition)
nmap <buffer> gpd <plug>(lsp-peek-definition)

View File

@ -10,7 +10,20 @@ Plugin 'majutsushi/tagbar'
"Plugin 'scrooloose/nerdcommenter'
"Plugin 'kalafut/vim-taskjuggler'
Plugin 'iamcco/markdown-preview.nvim'
"Plugin 'godlygeek/tabular'
"Plugin 'preservim/vim-markdown'
" debugging inside vim
"Plugin 'Shougo/vimproc.vim'
"Plugin 'idanarye/vim-vebugger'
Plugin 'puremourning/vimspector'
Plugin 'sagi-z/vimspectorpy', { 'do': { -> vimspectorpy#update() } }
" asyncrun for flask debug
"Plug 'skywind3000/asyncrun.vim'
Plugin 'kalafut/vim-taskjuggler'
Plugin 'liuchengxu/graphviz.vim'
Plugin 'weirongxu/plantuml-previewer.vim'
Plugin 'aklt/plantuml-syntax'
Plugin 'tyru/open-browser.vim.git'

View File

@ -71,6 +71,18 @@ autocmd! BufRead,BufNewFile *.ics setfiletype icalendar
au BufRead,BufNewFile *.pde set filetype=arduino
au BufRead,BufNewFile *.ino set filetype=arduino
if executable('arduino-language-server')
let g:lsp_semantic_enabled = 0
au User lsp_setup call lsp#register_server({
\ 'name': 'arduino-language-server',
\ 'cmd': {server_info->['/home/waldek/bin/arduino-language-server', '-clangd', '/usr/bin/clangd', '-cli', '/home/waldek/bin/arduino-cli', '-cli-config', '/home/waldek/.arduino15/arduino-cli.yaml', '-fqbn', 'arduino:renesas_uno', '-log', '-logpath', '/tmp']},
\ 'whitelist': ['arduino'],
\ 'workspace_config': lsp_settings#get('arduino-language-server', 'workspace_config', {}),
\ })
endif
"\ 'cmd': {server_info->['arduino-language-server -clangd /usr/bin/clangd -cli /home/waldek/bin/arduino-cli -cli-config /home/waldek/.arduino15/arduino-cli.yaml -fqbn arduino:mbed:nanorp2040connect'],},
"
" vimscript
" ----
@ -88,19 +100,71 @@ set foldmethod=expr
\ foldexpr=lsp#ui#vim#folding#foldexpr()
\ foldtext=lsp#ui#vim#folding#foldtext()
let g:lsp_hover_conceal=1
let g:markdown_syntax_conceal=1
" lsp-settings
" ------------
"let g:lsp_settings_filetype_python = ['pylsp-all', 'pyright-langserver']
"let g:lsp_settings_filetype_python = ['pyright-langserver']
let g:lsp_settings_filetype_python = ['pylsp-all']
"let g:lsp_settings = {
"\ 'pyls-all': {
"\ 'workspace_config': {
"\ 'pyls': {
"\ 'configurationSources': ['pycodestyle'],
"\ 'plugins': {
"\ 'pycodestyle': {
"\ 'enabled': v:false,
"\ 'ignore': ['E501']
"\ },
"\ "pyls_mypy":
"\ {
"\ "enabled": v:true,
"\ "live_mode": v:false
"\ },
"\ }
"\ }
"\ }
"\ },
"\}
" ale-lsp settings
" ----------------
let g:lsp_diagnostics_enabled = 1
let g:lsp_diagnostics_echo_cursor = 1
let g:lsp_diagnostics_float_cursor = 1
let g:lsp_diagnostics_highlights_enabled = 1
let g:lsp_diagnostics_signs_enabled = 1
let g:lsp_diagnostics_virtual_text_enabled = 1
let g:ale_sign_column_always = 1
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
nmap <silent> <C-j> <Plug>(ale_next_wrap)
" Check Python files with flake8 and pylint.
" let b:ale_linters = ['flake8', 'pylint']
" Fix Python files with autopep8 and yapf.
let b:ale_fixers = ['autopep8', 'yapf', 'remove_trailing_lines', 'trim_whitespace', 'black', 'pycln', 'isort']
" pylint seems to not like venvs...
let g:ale_linters = {
\ 'go': ['vim-lsp'],
\ 'python': ['vim-lsp'],
\ }
" 'cmd': {server_info->['/home/waldek/.virtualenvs/configuration-language-server-/bin/confls']},
au User lsp_setup
\ call lsp#register_server({
\ 'name': 'confls',
\ 'tcp': '127.0.0.1:9999',
\ 'cmd': {server_info->['pyls']},
\ 'allowlist': ['systemd']
\ })
"au User lsp_setup
" \ call lsp#register_server({
" \ 'name': 'confls',
" \ 'tcp': '127.0.0.1:9999',
" \ 'cmd': {server_info->['pyls']},
" \ 'allowlist': ['systemd']
" \ })
"if executable('/home/waldek/.virtualenvs/configuration-language-server-/bin/confls')
" " pip install python-language-server
@ -127,7 +191,32 @@ let g:NERDDefaultAlign = 'left'
" vebugger
" --------
let g:vebugger_leader='<Leader>d'
"let g:vebugger_leader='<Leader>d'
" vimspector
" --------
let g:vimspector_enable_mappings = 'HUMAN'
set signcolumn=yes
sign define vimspectorBP text=\ ● texthl=WarningMsg
sign define vimspectorBPCond text=\ ◆ texthl=WarningMsg
sign define vimspectorBPLog text=\ ◆ texthl=SpellRare
sign define vimspectorBPDisabled text=\ ● texthl=LineNr
sign define vimspectorPC text=\ ▶ texthl=MatchParen linehl=CursorLine
sign define vimspectorPCBP text=●▶ texthl=MatchParen linehl=CursorLine
sign define vimspectorCurrentThread text=▶ texthl=MatchParen linehl=CursorLine
sign define vimspectorCurrentFrame text=▶ texthl=Special linehl=CursorLine
" asyncrun
" --------
let $PYTHONUNBUFFERED=1
let g:asyncrun_open = 8
"autocmd filetype python noremap <F5> :AsyncRun -cwd=$(VIM_FILEDIR) -raw python3 "$(VIM_FILEPATH)"<CR>
"noremap <F6> :AsyncStop<CR>
"noremap <F10> :cclose<CR>
" marker specific
" ---------------
@ -161,7 +250,7 @@ let g:SignatureMap = {
" set to 1, nvim will open the preview window after entering the markdown buffer
" default: 0
let g:mkdp_auto_start = 1
let g:mkdp_auto_start = 0
" set to 1, the nvim will auto close current preview window when change
" from markdown buffer to another buffer
@ -250,6 +339,6 @@ let g:mkdp_page_title = '${name}'
" these filetypes will have MarkdownPreview... commands
let g:mkdp_filetypes = ['markdown']
autocmd FileType mail nmap <F5> <Plug>MarkdownPreview
autocmd FileType mail nmap <F6> <Plug>MarkdownPreviewStop
autocmd FileType mail nmap <F7> <Plug>MarkdownPreviewToggle
autocmd FileType markdown nmap <F5> <Plug>MarkdownPreview
autocmd FileType markdown nmap <F6> <Plug>MarkdownPreviewStop
autocmd FileType markdown nmap <F7> <Plug>MarkdownPreviewToggle