155 lines
3.9 KiB
Plaintext
155 lines
3.9 KiB
Plaintext
" ----------------------------------------------------------------------------
|
|
" waldek additions essentials
|
|
" ----------------------------------------------------------------------------
|
|
|
|
" close all windows except the one you're in
|
|
nmap <leader>o :only <cr>
|
|
|
|
" use the arrows for buffer navigation
|
|
nnoremap <down> <C-W><C-J>
|
|
nnoremap <up> <C-W><C-K>
|
|
nnoremap <left> <C-W><C-H>
|
|
nnoremap <right> <C-W><C-L>
|
|
|
|
" use CTRL-motion for buffer navigation
|
|
nnoremap <C-h> <C-w>h
|
|
nnoremap <C-j> <C-w>j
|
|
nnoremap <C-k> <C-w>k
|
|
nnoremap <C-l> <C-w>l
|
|
|
|
" don't use the arrows for insert navigation
|
|
inoremap <Down> <Nop>
|
|
inoremap <Up> <Nop>
|
|
inoremap <Left> <Nop>
|
|
inoremap <Right> <Nop>
|
|
|
|
" more natural splits set splitbelow
|
|
set splitright
|
|
set splitbelow
|
|
|
|
" ----------------------------------------------------------------------------
|
|
" waldek filetype specific
|
|
" ----------------------------------------------------------------------------
|
|
|
|
" python3
|
|
" -------
|
|
|
|
" let gi introspection work
|
|
if has('python3')
|
|
py3 << EOF
|
|
import os.path
|
|
import sys
|
|
import vim
|
|
sys.path.insert(0, os.path.join(os.path.expanduser('~'), '.cache/fakegir/'))
|
|
EOF
|
|
endif
|
|
|
|
" run code in new window
|
|
let _pymain="null"
|
|
map <leader>rs :let _pymain=expand('%:p')<CR>
|
|
map <leader>ru :let _pymain="null"<CR>
|
|
map <leader>r :execute '!x-terminal-emulator -e python3 ~/bin/python/vim_run.py ' . &filetype expand('%:p') _pymain <CR><CR>
|
|
map <leader>rr :execute '!x-terminal-emulator -e python3 ~/bin/python/vim_run.py ' . &filetype expand('%:p') "null" <CR><CR>
|
|
|
|
" mail
|
|
" ----
|
|
|
|
" mail should not wrap for mutt
|
|
autocmd FileType mail set textwidth=0
|
|
|
|
" ical
|
|
" ----
|
|
|
|
autocmd! BufRead,BufNewFile *.ics setfiletype icalendar
|
|
|
|
" arduino
|
|
" -------
|
|
|
|
au BufRead,BufNewFile *.pde set filetype=arduino
|
|
au BufRead,BufNewFile *.ino set filetype=arduino
|
|
|
|
" vimscript
|
|
" ----
|
|
|
|
" mail should not wrap for mutt
|
|
autocmd FileType vim nnoremap <buffer> <F5> :source % <CR>
|
|
|
|
" ----------------------------------------------------------------------------
|
|
" waldek plugins specific
|
|
" ----------------------------------------------------------------------------
|
|
|
|
" vim-lsp
|
|
" -------
|
|
|
|
set foldmethod=expr
|
|
\ foldexpr=lsp#ui#vim#folding#foldexpr()
|
|
\ foldtext=lsp#ui#vim#folding#foldtext()
|
|
|
|
" lsp-settings
|
|
" ------------
|
|
|
|
" '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']
|
|
\ })
|
|
|
|
"if executable('/home/waldek/.virtualenvs/configuration-language-server-/bin/confls')
|
|
" " pip install python-language-server
|
|
" au User lsp_setup call lsp#register_server({
|
|
" \ 'name': 'confls',
|
|
" \ 'tcp': "localhost:9999",
|
|
" \ 'allowlist': ['systemd'],
|
|
" \ })
|
|
"endif
|
|
|
|
|
|
" TagBar
|
|
" ------
|
|
|
|
nmap <leader>c :TagbarToggle <cr>
|
|
|
|
" nerdtree
|
|
" --------
|
|
|
|
map <leader>n :NERDTreeToggle<CR>
|
|
let g:NERDTreeWinSize=30
|
|
let g:NERDDefaultAlign = 'left'
|
|
|
|
" vebugger
|
|
" --------
|
|
|
|
let g:vebugger_leader='<Leader>d'
|
|
|
|
" marker specific
|
|
" ---------------
|
|
|
|
let g:SignatureMap = {
|
|
\ 'Leader' : "m",
|
|
\ 'PlaceNextMark' : "mm",
|
|
\ 'ToggleMarkAtLine' : "m.",
|
|
\ 'PurgeMarksAtLine' : "m-",
|
|
\ 'DeleteMark' : "dm",
|
|
\ 'PurgeMarks' : "m<Space>",
|
|
\ 'PurgeMarkers' : "m<BS>",
|
|
\ 'GotoNextLineAlpha' : "m]",
|
|
\ 'GotoPrevLineAlpha' : "m[",
|
|
\ 'GotoNextSpotAlpha' : "M]",
|
|
\ 'GotoPrevSpotAlpha' : "M[",
|
|
\ 'GotoNextLineByPos' : "]m",
|
|
\ 'GotoPrevLineByPos' : "[m",
|
|
\ 'GotoNextSpotByPos' : "]M",
|
|
\ 'GotoPrevSpotByPos' : "[M",
|
|
\ 'GotoNextMarker' : "]-",
|
|
\ 'GotoPrevMarker' : "[-",
|
|
\ 'GotoNextMarkerAny' : "]=",
|
|
\ 'GotoPrevMarkerAny' : "[=",
|
|
\ 'ListBufferMarks' : "m/",
|
|
\ 'ListBufferMarkers' : "m?"
|
|
\ }
|