" ---------------------------------------------------------------------------- " waldek additions essentials " ---------------------------------------------------------------------------- " close all windows except the one you're in nmap o :only " use the arrows for buffer navigation nnoremap nnoremap nnoremap nnoremap " use CTRL-motion for buffer navigation nnoremap h nnoremap j nnoremap k nnoremap l " don't use the arrows for insert navigation inoremap inoremap inoremap inoremap " more natural splits set splitbelow set splitright set splitbelow " autorefresh syntax highlighting autocmd BufEnter * :syntax sync fromstart " ---------------------------------------------------------------------------- " 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 rs :let _pymain=expand('%:p') map ru :let _pymain="null" map r :execute '!x-terminal-emulator -e python3 ~/bin/python/vim_run.py ' . &filetype expand('%:p') _pymain map rr :execute '!x-terminal-emulator -e python3 ~/bin/python/vim_run.py ' . &filetype expand('%:p') "null" " 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 :source % " ---------------------------------------------------------------------------- " waldek plugins specific " ---------------------------------------------------------------------------- " vim-lsp " ------- 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 " ------------ " '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 c :TagbarToggle " nerdtree " -------- map n :NERDTreeToggle let g:NERDTreeWinSize=30 let g:NERDDefaultAlign = 'left' " vebugger " -------- "let g:vebugger_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 :AsyncRun -cwd=$(VIM_FILEDIR) -raw python3 "$(VIM_FILEPATH)" "noremap :AsyncStop "noremap :cclose " marker specific " --------------- let g:SignatureMap = { \ 'Leader' : "m", \ 'PlaceNextMark' : "mm", \ 'ToggleMarkAtLine' : "m.", \ 'PurgeMarksAtLine' : "m-", \ 'DeleteMark' : "dm", \ 'PurgeMarks' : "m", \ 'PurgeMarkers' : "m", \ 'GotoNextLineAlpha' : "m]", \ 'GotoPrevLineAlpha' : "m[", \ 'GotoNextSpotAlpha' : "M]", \ 'GotoPrevSpotAlpha' : "M[", \ 'GotoNextLineByPos' : "]m", \ 'GotoPrevLineByPos' : "[m", \ 'GotoNextSpotByPos' : "]M", \ 'GotoPrevSpotByPos' : "[M", \ 'GotoNextMarker' : "]-", \ 'GotoPrevMarker' : "[-", \ 'GotoNextMarkerAny' : "]=", \ 'GotoPrevMarkerAny' : "[=", \ 'ListBufferMarks' : "m/", \ 'ListBufferMarkers' : "m?" \ } " markdown preview " ---------------- " set to 1, nvim will open the preview window after entering the markdown buffer " default: 0 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 " default: 1 let g:mkdp_auto_close = 1 " set to 1, the vim will refresh markdown when save the buffer or " leave from insert mode, default 0 is auto refresh markdown as you edit or " move the cursor " default: 0 let g:mkdp_refresh_slow = 0 " set to 1, the MarkdownPreview command can be use for all files, " by default it can be use in markdown file " default: 0 let g:mkdp_command_for_global = 0 " set to 1, preview server available to others in your network " by default, the server listens on localhost (127.0.0.1) " default: 0 let g:mkdp_open_to_the_world = 0 " use custom IP to open preview page " useful when you work in remote vim and preview on local browser " more detail see: https://github.com/iamcco/markdown-preview.nvim/pull/9 " default empty let g:mkdp_open_ip = '' " specify browser to open preview page " default: '' let g:mkdp_browser = '/usr/bin/firefox' " set to 1, echo preview page url in command line when open preview page " default is 0 let g:mkdp_echo_preview_url = 1 " a custom vim function name to open preview page " this function will receive url as param " default is empty let g:mkdp_browserfunc = '' " options for markdown render " mkit: markdown-it options for render " katex: katex options for math " uml: markdown-it-plantuml options " maid: mermaid options " disable_sync_scroll: if disable sync scroll, default 0 " sync_scroll_type: 'middle', 'top' or 'relative', default value is 'middle' " middle: mean the cursor position alway show at the middle of the preview page " top: mean the vim top viewport alway show at the top of the preview page " relative: mean the cursor position alway show at the relative positon of the preview page " hide_yaml_meta: if hide yaml metadata, default is 1 " sequence_diagrams: js-sequence-diagrams options " content_editable: if enable content editable for preview page, default: v:false " disable_filename: if disable filename header for preview page, default: 0 let g:mkdp_preview_options = { \ 'mkit': {}, \ 'katex': {}, \ 'uml': {}, \ 'maid': {}, \ 'disable_sync_scroll': 0, \ 'sync_scroll_type': 'relative', \ 'hide_yaml_meta': 1, \ 'sequence_diagrams': {}, \ 'flowchart_diagrams': {}, \ 'content_editable': v:false, \ 'disable_filename': 0 \ } " use a custom markdown style must be absolute path " like '/Users/username/markdown.css' or expand('~/markdown.css') let g:mkdp_markdown_css = '' " use a custom highlight style must absolute path " like '/Users/username/highlight.css' or expand('~/highlight.css') let g:mkdp_highlight_css = '' " use a custom port to start server or random for empty let g:mkdp_port = '' " preview page title " ${name} will be replace with the file name let g:mkdp_page_title = '${name}' " recognized filetypes " these filetypes will have MarkdownPreview... commands let g:mkdp_filetypes = ['markdown'] autocmd FileType markdown nmap MarkdownPreview autocmd FileType markdown nmap MarkdownPreviewStop autocmd FileType markdown nmap MarkdownPreviewToggle