" ╔════════════════════════════════════════════════════════════════════════════╗ " ║ ║ " ║ ██╗ ██╗██╗███╗ ███╗ ║ " ║ ██║ ██║██║████╗ ████║ ║ " ║ ██║ ██║██║██╔████╔██║ ║ " ║ ╚██╗ ██╔╝██║██║╚██╔╝██║ ║ " ║ ╚████╔╝ ██║██║ ╚═╝ ██║ ║ " ║ ╚═══╝ ╚═╝╚═╝ ╚═╝ ║ " ║ ║ " ║ xn--gckvb8fzb.com * github.com/mrusme * marius@xn--gckvb8fzb.com ║ " ║ ║ " ╚════════════════════════════════════════════════════════════════════════════╝ " " TODO: https://kinbiko.com/posts/2021-08-23-rewriting-vimrc-in-lua/ " set nocompatible filetype off " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ Plugs ║ " ╚════════════════════════════════════════════════════════════════════════════╝ call plug#begin('~/.local/share/nvim/plugged') Plug 'editorconfig/editorconfig-vim' Plug 'neovim/nvim-lspconfig' Plug 'onsails/lspkind.nvim' Plug 'hrsh7th/cmp-nvim-lsp' Plug 'hrsh7th/cmp-buffer' Plug 'hrsh7th/cmp-path' Plug 'hrsh7th/cmp-cmdline' Plug 'hrsh7th/nvim-cmp' Plug 'hrsh7th/cmp-vsnip' Plug 'hrsh7th/vim-vsnip' Plug 'jose-elias-alvarez/null-ls.nvim' Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'lambdalisue/fern.vim' Plug 'lambdalisue/nerdfont.vim' Plug 'lambdalisue/fern-renderer-nerdfont.vim' Plug 'lambdalisue/fern-git-status.vim' Plug 'lambdalisue/fern-hijack.vim' Plug 'lambdalisue/fern-bookmark.vim' Plug 'lambdalisue/fern-mapping-git.vim' Plug 'ggandor/leap.nvim' Plug 'ggandor/lightspeed.nvim' Plug 'lambdalisue/glyph-palette.vim' Plug 'numToStr/Comment.nvim' Plug 'lewis6991/gitsigns.nvim' Plug 'godlygeek/tabular' Plug 'junegunn/goyo.vim' Plug 'Yggdroot/indentLine' Plug 'mg979/vim-visual-multi', {'branch': 'master'} Plug 'itchyny/lightline.vim' Plug 'wfxr/minimap.vim' Plug 'jamessan/vim-gnupg' Plug 'glepnir/dashboard-nvim' Plug 'robertbasic/vim-hugo-helper' Plug 'windwp/nvim-autopairs' Plug 'tpope/vim-abolish' Plug 'lervag/wiki.vim' Plug 'nvim-lua/popup.nvim' Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim' Plug 'simnalamburt/vim-mundo' Plug 'kyazdani42/nvim-web-devicons' " Plug 'folke/trouble.nvim' Plug 'mhartington/formatter.nvim' Plug 'folke/which-key.nvim' " Plug 'RRethy/nvim-base16' " Plug 'danilamihailov/beacon.nvim' " Syntax / Language integrations "Plug 'plasticboy/vim-markdown' Plug 'leafgarland/typescript-vim' Plug 'elixir-lang/vim-elixir' Plug 'fatih/vim-go' Plug 'rust-lang/rust.vim' Plug 'cespare/vim-toml', {'branch': 'main'} Plug 'moll/vim-node' Plug 'docker/docker' Plug 'evanleck/vim-svelte', {'branch': 'main'} Plug 'vim-scripts/dbext.vim' Plug 'ledger/vim-ledger' Plug 'chrisbra/Colorizer' call plug#end() " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ Configuration ║ " ╚════════════════════════════════════════════════════════════════════════════╝ filetype plugin indent on filetype plugin on if has('autocmd') filetype plugin indent on endif if has('syntax') && !exists('g:syntax_on') syntax enable endif " Jeez, who even wants that ... set mouse=a set clipboard=unnamed,unnamedplus set encoding=utf-8 set autoindent set number set backspace=indent,eol,start set showmatch set showmode set smarttab set complete-=i set nrformats-=octal set shiftround set ttimeout set ttimeoutlen=50 set timeoutlen=500 set incsearch set laststatus=2 set ruler set showcmd set wildmenu set autoread " 2 spaces tab, expand tabs to spaces set tabstop=2 shiftwidth=2 expandtab "set listchars=tab:▒░,trail:▓ set listchars=tab:⇥\ ,trail:˽,extends:→ set list set number relativenumber " set number set hlsearch " highlight the current line set cursorline " ignore case when searching ... set ignorecase " ... unless the search contains mixed case, then don't ignore set smartcase " begin scrolling x lines before bottom set scrolloff=10 set hidden set nobackup set nowritebackup set noswapfile set fileformats=unix,dos,mac set completeopt=menu,menuone,noselect set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,**/node_modules/** "set spelllang=en,ro,es,fr,de,cjk " set spelllang=en,es,de set spelllang=en,de set spellsuggest=best,9 if exists("+colorcolumn") set colorcolumn=80 endif if maparg('', 'n') ==# '' nnoremap :nohlsearch endif inoremap u noremap :update vnoremap :update inoremap :update "inoremap "map / vnoremap > vnoremap < "nnoremap >0 "nnoremap <0 vmap gc vmap S vmap d vmap p vmap y "nnoremap d "_d "vnoremap d "_d nnoremap :Files nnoremap :undo inoremap :undo nnoremap :redo inoremap :redo inoremap V inoremap ggVG inoremap o nnoremap :tabprevious inoremap :tabpreviousi nnoremap :tabnext inoremap :tabnexti nnoremap :tabnew inoremap :tabnewi nnoremap :tabclose inoremap :tabclosei nnoremap :tabn 1 inoremap :tabn 1i nnoremap :tabn 2 inoremap :tabn 2i nnoremap :tabn 3 inoremap :tabn 3i nnoremap :tabn 4 inoremap :tabn 4i nnoremap :tabn 5 inoremap :tabn 5i nnoremap :tabn 6 inoremap :tabn 6i nnoremap :tabn 7 inoremap :tabn 7i nnoremap :tabn 8 inoremap :tabn 8i nnoremap :tabn 9 inoremap :tabn 9i nnoremap :tabn 10 inoremap :tabn 10i map \ : let mapleader = ',' nnoremap p :set paste nnoremap o :set nopaste " Double press Ctrl+q to force quit, discarding changes noremap :qa! inoremap :qa! " Single press Ctrl+q to quit, get notified of changes noremap :qa inoremap :qa " Reformat current paragraph noremap ` gq} " Reformat everything to EOF noremap ~ gqG " Auto formatting per syntax nnoremap fj :%!python -m json.tool let g:VM_maps = {} let g:VM_maps['Find Under'] = '' let g:VM_maps['Find Subword Under'] = '' let g:VM_maps["Select Cursor Down"] = '' let g:VM_maps["Select Cursor Up"] = '' let g:tcomment#replacements_xml={} let g:vim_markdown_folding_disabled = 1 " save window position on exit autocmd BufWinLeave \ *.* mkview " restore window position autocmd BufWinEnter \ *.* silent! loadview " set markdown filetype autocmd BufRead,BufNewFile \ *.md set filetype=markdown " set textwidth=80 for types and enable spell autocmd BufRead,BufNewFile \ *.{md,txt} \ setlocal tw=80 | \ setlocal colorcolumn=80 | \ setlocal fo=awqtc | \ setlocal comments+=nb:> | \ setlocal spell " set json filetyep autocmd BufRead,BufNewFile \ .{jscs,jshint,eslint}rc set filetype=json " set sh filetype autocmd BufRead,BufNewFile \ aliases.local,zshrc.local,.zshrc,*/zsh/configs/* set filetype=sh " set gitconfig filetyep autocmd BufRead,BufNewFile \ gitconfig.local,.gitconfig set filetype=gitconfig " set tmux filetype autocmd BufRead,BufNewFile \ tmux.conf.local,tmux.conf,.tmux.conf set filetype=tmux " set vim filetype autocmd BufRead,BufNewFile \ vimrc.local,.vimrc,init.vim set filetype=vim " set neomutt settings autocmd BufRead,BufNewFile \ {neomutt-*,*.eml} \ setlocal tw=72 | \ setlocal colorcolumn=72 | \ setlocal fo=awq | \ setlocal comments+=nb:> | \ setlocal spell | \ match ErrorMsg '\s\+$' " save cursor position from last time autocmd BufReadPost * \ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit' \ | exe "normal! g`\"" \ | endif " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ Theme ║ " ╚════════════════════════════════════════════════════════════════════════════╝ if has('termguicolors') set termguicolors endif if (has('nvim')) let $NVIM_TUI_ENABLE_TRUE_COLOR = 1 endif set t_Co=256 colorscheme iceberg " lua << EOF " require('base16-colorscheme').setup({ " base00 = '#161616', " base01 = '#262626', " base02 = '#393939', " base03 = '#525252', " base04 = '#6F6F6F', " base05 = '#FAFAFA', " base06 = '#FAFAFA', " base07 = '#FFFFFF', " base08 = '#be95ff', " base09 = '#3ddbd9', " base0A = '#0043ce', " base0B = '#33b1ff', " base0C = '#ff7eb6', " base0D = '#42be65', " base0E = '#be95ff', " base0F = '#3ddbd9', " }) " EOF " OVERRIDES highlight Normal ctermbg=none guibg=none highlight NonText ctermbg=none guibg=none highlight ColorColumn cterm=reverse ctermbg=238 ctermfg=233 \ gui=reverse guibg=#3e445e guifg=#0f1117 highlight EndOfBuffer ctermbg=none guibg=none highlight LineNr ctermbg=none guibg=none " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ indentLine ║ " ╚════════════════════════════════════════════════════════════════════════════╝ let g:indentLine_enabled = 1 let g:indentLine_char = '⋮' let g:indentLine_first_char = '⋮' let g:indentLine_showFirstIndentLevel = 1 let g:indentLine_setColors = 1 let g:indentLine_setConceal = 0 let g:indentLine_fileTypeExclude = ['dashboard'] " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ Neovide ║ " ╚════════════════════════════════════════════════════════════════════════════╝ if exists("g:neovide") set mouse=a set guifont=FiraCode\ Nerd\ Font:h10 let g:neovide_cursor_antialiasing=v:true ""let g:neovide_fullscreen=v:true let g:neovide_refresh_rate=60 let g:neovide_refresh_rate_idle=5 "let g:neovide_keyboard_layout="qwerty" let g:neovide_keyboard_layout="qwertz" let g:neovide_cursor_animation_length=0.01 " let g:neovide_cursor_animation_length=0.05 let g:neovide_cursor_trail_length=0.2 let g:neovide_transparency=0.9 endif " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ Lightline ║ " ╚════════════════════════════════════════════════════════════════════════════╝ let g:lightline = { \ 'colorscheme': 'iceberg', \ 'active': { \ 'left': [ [ 'mode', 'paste' ], \ [ 'readonly', 'filename', 'gitsign', 'modified' ] ], \ 'right': [ \ [ 'lineinfo' ], [ 'percent' ], \ [ 'indent', 'textwidth', 'fileformat', \ 'fileencoding', 'filetype', 'branch' ] \ ] \ }, \ 'component': { \ 'indent': '%{&expandtab?"spaces":"tabs"}:%{&expandtab?&shiftwidth:&tabstop}', \ 'textwidth': '%{&textwidth}', \ 'gitsign': '%{get(b:,"gitsigns_status","")}', \ 'branch': '%{get(b:,"gitsigns_head","")}', \ }, \ } set noshowmode " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ Fern ║ " ╚════════════════════════════════════════════════════════════════════════════╝ " fern-renderer-nerdfont let g:fern#renderer = "nerdfont" " fern-git-status " Disable listing ignored files/directories let g:fern_git_status#disable_ignored = 0 " Disable listing untracked files let g:fern_git_status#disable_untracked = 0 " Disable listing status of submodules let g:fern_git_status#disable_submodules = 0 " Disable listing status of directories let g:fern_git_status#disable_directories = 0 " glyph-palette augroup my-glyph-palette autocmd! * autocmd FileType fern call glyph_palette#apply() autocmd FileType nerdtree,startify call glyph_palette#apply() augroup END let g:fern#disable_default_mappings = 0 let g:fern#disable_drawer_smart_quit = 0 noremap :Fern . -drawer -width=35 -toggle noremap d :Fern . -drawer -width=35 -toggle "noremap f :Fern . -drawer -reveal=% -width=35 noremap . :Fern %:h -drawer -width=35 noremap :Fern bookmark:/// -drawer -width=35 -toggle noremap b :Fern bookmark:/// -drawer -width=35 -toggle function! FernInit() abort nmap \ (fern-my-open-expand-collapse) \ fern#smart#leaf( \ "\(fern-action-open:select)", \ "\(fern-action-expand)", \ "\(fern-action-collapse)", \ ) nmap (fern-my-open-expand-collapse) "nmap <2-LeftMouse> (fern-my-open-expand-collapse) nmap m (fern-action-mark:toggle)j nmap N (fern-action-new-file) nmap K (fern-action-new-dir) nmap D (fern-action-remove) nmap V (fern-action-move) nmap R (fern-action-rename) nmap s (fern-action-open:split) nmap v (fern-action-open:vsplit) nmap r (fern-action-reload) nmap d (fern-action-hidden:toggle) nmap < (fern-action-leave) nmap > (fern-action-enter) endfunction augroup FernEvents autocmd! autocmd FileType fern call FernInit() augroup END " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ EditorConfig ║ " ╚════════════════════════════════════════════════════════════════════════════╝ let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*'] let g:EditorConfig_max_line_indicator = "line" au FileType gitcommit let b:EditorConfig_disable = 1 " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ GitSigns ║ " ╚════════════════════════════════════════════════════════════════════════════╝ lua < f :Format " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ rust.vim ║ " ╚════════════════════════════════════════════════════════════════════════════╝ let g:rust_clip_command = 'wl-copy' " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ cmp ║ " ╚════════════════════════════════════════════════════════════════════════════╝ lua <'] = (function(fallback) if cmp.visible() then cmp.select_next_item() else fallback() end end), [''] = (function(fallback) if cmp.visible() then cmp.select_prev_item() else fallback() end end), [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.abort(), [''] = cmp.mapping.confirm({ select = true }), }), sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'vsnip' }, }, { { name = 'buffer' }, }), formatting = { format = lspkind.cmp_format({ mode = 'symbol', maxwidth = 50, }) } }) cmp.setup.filetype('gitcommit', { sources = cmp.config.sources({ { name = 'cmp_git' }, }, { { name = 'buffer' }, }) }) cmp.setup.filetype('markdown', { enabled = false }) -- Use buffer source for `/` (if enabled `native_menu`, this won't work anymore). cmp.setup.cmdline('/', { sources = { { name = 'buffer' } } }) -- Use cmdline & path source for ':' (if enabled `native_menu`, this won't work anymore). cmp.setup.cmdline(':', { sources = cmp.config.sources({ { name = 'path' } }, { { name = 'cmdline' } }) }) cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = '' } })) local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities()) require('lspconfig')['gopls'].setup { capabilities = capabilities } require('lspconfig')['clangd'].setup { capabilities = capabilities } require('lspconfig')['denols'].setup { capabilities = capabilities } require('lspconfig')['elixirls'].setup { capabilities = capabilities; cmd = { "/home/mrus/projects/github/elixir-ls/release/language_server.sh" }; } require('lspconfig')['pylsp'].setup { capabilities = capabilities } require('lspconfig')['rust_analyzer'].setup { capabilities = capabilities } require('lspconfig')['rls'].setup { capabilities = capabilities } require('lspconfig')['sorbet'].setup { capabilities = capabilities; cmd = { "bundle", "exec", "srb", "tc", "--lsp" }; } require('lspconfig')['sqls'].setup { capabilities = capabilities } require('lspconfig')['terraformls'].setup { capabilities = capabilities } require('lspconfig')['tflint'].setup { capabilities = capabilities } require('lspconfig')['bashls'].setup { capabilities = capabilities } require('lspconfig')['cssls'].setup { capabilities = capabilities } require('lspconfig')['dockerls'].setup { capabilities = capabilities } require('lspconfig')['graphql'].setup { capabilities = capabilities } require('lspconfig')['html'].setup { capabilities = capabilities } require('lspconfig')['jsonls'].setup { capabilities = capabilities } require('lspconfig')['stylelint_lsp'].setup { capabilities = capabilities } require('lspconfig')['svelte'].setup { capabilities = capabilities } require('lspconfig')['tsserver'].setup { capabilities = capabilities } require('lspconfig')['vimls'].setup { capabilities = capabilities } require('lspconfig')['yamlls'].setup { capabilities = capabilities } require('lspconfig')['zls'].setup { capabilities = capabilities; cmd = { "/home/mrus/projects/github/zls/zig-out/bin/zls" }; } EOF highlight link CompeDocumentation NormalFloat highlight link CmpDocumentation NormalFloat " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ null-ls ║ " ╚════════════════════════════════════════════════════════════════════════════╝ lua << EOF require("null-ls").setup({ sources = { require("null-ls").builtins.diagnostics.vale, }, }) EOF " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ Treesitter ║ " ╚════════════════════════════════════════════════════════════════════════════╝ lua << EOF require'nvim-treesitter.configs'.setup { -- A list of parser names, or "all" ensure_installed = { "bash", "c", "cmake", "comment", "cpp", "css", "dockerfile", "eex", "elixir", "erlang", "go", "gomod", "graphql", "haskell", "hcl", "html", "http", "javascript", "json", "lua", "make", "markdown", "nix", "regex", "ruby", "rust", "scss", "svelte", "toml", "typescript", "vim", "yaml", "zig" }, sync_install = false, ignore_install = {}, highlight = { enable = true, disable = {}, -- Setting this to true will run `:h syntax` and tree-sitter at the same time. -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). -- Using this option may slow down your editor, and you may see some duplicate highlights. -- Instead of true it can also be a list of languages additional_vim_regex_highlighting = false, }, } EOF " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ Leap ║ " ╚════════════════════════════════════════════════════════════════════════════╝ " Conflicts with a lot of mappings (e.g. x), needs further investigation " lua require('leap').add_default_mappings() " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ Telescope ║ " ╚════════════════════════════════════════════════════════════════════════════╝ nnoremap lua require('telescope.builtin').find_files() nnoremap lua require('telescope.builtin').live_grep() nnoremap fb lua require('telescope.builtin').buffers() nnoremap fh lua require('telescope.builtin').help_tags() nnoremap lr lua require('telescope.builtin').lsp_references() nnoremap lua require('telescope.builtin').fd() inoremap lua require('telescope.builtin').fd() " nnoremap Telescope find_files " nnoremap Telescope live_grep " nnoremap fb Telescope buffers " nnoremap fh Telescope help_tags " nnoremap lr Telescope lsp_references " " nnoremap Telescope fd " inoremap Telescope fd " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ Minimap ║ " ╚════════════════════════════════════════════════════════════════════════════╝ let g:minimap_width = 10 let g:minimap_auto_start = 0 let g:minimap_auto_start_win_enter = 0 let g:minimap_block_filetypes = ['fern', 'fugitive', 'nerdtree', 'tagbar' ] let g:minimap_block_buftypes = [ \'fern', 'nofile', 'nowrite', 'quickfix', 'terminal', 'prompt' \] let g:minimap_highlight_search = 1 let g:minimap_highlight_range = 1 let g:minimap_git_colors = 1 noremap :MinimapToggle:MinimapRescan:MinimapRefresh " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ lexima ║ " ╚════════════════════════════════════════════════════════════════════════════╝ let g:lexima_enable_basic_rules = 1 let g:lexima_enable_newline_rules = 1 let g:lexima_enable_endwise_rules = 1 " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ Mundo ║ " ╚════════════════════════════════════════════════════════════════════════════╝ nnoremap :MundoToggle " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ GPG ║ " ╚════════════════════════════════════════════════════════════════════════════╝ autocmd User GnuPG setl textwidth=72 let g:GPGFilePattern = '*.\(gpg\|asc\|pgp\)\(.wiki\|.md\)\=' " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ Dashboard ║ " ╚════════════════════════════════════════════════════════════════════════════╝ lua << EOF local home = os.getenv('HOME') local db = require('dashboard') db.preview_command = '/bin/cat' db.preview_file_path = home .. '/.config/nvim/motd' db.preview_file_width = 76 db.preview_file_height = 32 db.custom_center = { { icon = ' ', desc = 'New file', shortcut = 'SPC n f', action = 'enew' }, { icon = ' ', desc = 'Recently opened files ', action = 'DashboardFindHistory', shortcut = 'SPC f h' }, { icon = ' ', desc = 'Find File ', action = 'Telescope find_files find_command=rg,--hidden,--files', shortcut = 'SPC f f' }, { icon = ' ', desc ='File Browser ', action = 'Telescope file_browser', shortcut = 'SPC f b' }, { icon = ' ', desc = 'Find word ', aciton = 'DashboardFindWord', shortcut = 'SPC f w' }, } db.custom_footer = nil EOF " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ trouble.vim ║ " ╚════════════════════════════════════════════════════════════════════════════╝ "lua << EOF " require("trouble").setup { " position = "bottom", -- position of the list can be: bottom, top, left, right " height = 10, -- height of the trouble list when position is top or bottom " width = 50, -- width of the list when position is left or right " icons = true, -- use devicons for filenames " mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist" " fold_open = "", -- icon used for open folds " fold_closed = "", -- icon used for closed folds " group = true, -- group results by file " padding = true, -- add an extra new line on top of the list " action_keys = { -- key mappings for actions in the trouble list " -- map to {} to remove a mapping, for example: " -- close = {}, " close = "q", -- close the list " cancel = "", -- cancel the preview and get back to your last window / buffer / cursor " refresh = "r", -- manually refresh " jump = {"", ""}, -- jump to the diagnostic or open / close folds " open_split = { "" }, -- open buffer in new split " open_vsplit = { "" }, -- open buffer in new vsplit " open_tab = { "" }, -- open buffer in new tab " jump_close = {"o"}, -- jump to the diagnostic and close the list " toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode " toggle_preview = "P", -- toggle auto_preview " hover = "K", -- opens a small popup with the full multiline message " preview = "p", -- preview the diagnostic location " close_folds = {"zM", "zm"}, -- close all folds " open_folds = {"zR", "zr"}, -- open all folds " toggle_fold = {"zA", "za"}, -- toggle fold of current file " previous = "k", -- preview item " next = "j" -- next item " }, " indent_lines = true, -- add an indent guide below the fold icons " auto_open = true, -- automatically open the list when you have diagnostics " auto_close = false, -- automatically close the list when you have no diagnostics " auto_preview = true, -- automatically preview the location of the diagnostic. to close preview and go back to last window " auto_fold = false, -- automatically fold a file trouble list at creation " auto_jump = {"lsp_definitions"}, -- for the given modes, automatically jump if there is only a single result " signs = { " -- icons / text used for a diagnostic " error = "", " warning = "", " hint = "", " information = "", " other = "﫠" " }, " use_diagnostic_signs = true -- enabling this will use the signs defined in your lsp client " } "EOF " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ HugoHelper ║ " ╚════════════════════════════════════════════════════════════════════════════╝ let g:hugohelper_update_lastmod_on_write = 1 " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ Wiki.vim ║ " ╚════════════════════════════════════════════════════════════════════════════╝ let g:wiki_root = '~/cloud/notes' let g:wiki_filetypes = ['md'] let g:wiki_link_extension = '.md' let g:wiki_link_target_type = 'md' " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ vim-go ║ " ╚════════════════════════════════════════════════════════════════════════════╝ " let g:go_fmt_autosave=0 " let g:go_mod_fmt_autosave=0 " let g:go_imports_autosave = 0 " let g:go_asmfmt_autosave=0 " let g:go_def_mapping_enabled = 0 " au FileType go map (go-build) " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ Svelte ║ " ╚════════════════════════════════════════════════════════════════════════════╝ let g:svelte_indent_script = 0 let g:svelte_indent_style = 0 " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ Typescript ║ " ╚════════════════════════════════════════════════════════════════════════════╝ let g:typescript_indent_disable = 1 " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ Dbext ║ " ╚════════════════════════════════════════════════════════════════════════════╝ let g:dbext_default_menu_mode = 0 " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ Which Key ║ " ╚════════════════════════════════════════════════════════════════════════════╝ lua << EOF require("which-key").setup { plugins = { marks = true, -- shows a list of your marks on ' and ` registers = true, -- shows your registers on " in NORMAL or in INSERT mode spelling = { enabled = false, -- enabling this will show WhichKey when pressing z= to select spelling suggestions suggestions = 20, -- how many suggestions should be shown in the list? }, -- the presets plugin, adds help for a bunch of default keybindings in Neovim -- No actual key bindings are created presets = { operators = true, -- adds help for operators like d, y, ... and registers them for motion / text object completion motions = true, -- adds help for motions text_objects = true, -- help for text objects triggered after entering an operator windows = true, -- default bindings on nav = true, -- misc bindings to work with windows z = true, -- bindings for folds, spelling and others prefixed with z g = true, -- bindings for prefixed with g }, }, -- add operators that will trigger motion and text object completion -- to enable all native operators, set the preset / operators plugin above operators = { gc = "Comments" }, key_labels = { -- override the label used to display some keys. It doesn't effect WK in any other way. -- For example: -- [""] = "SPC", -- [""] = "RET", -- [""] = "TAB", }, icons = { breadcrumb = "»", -- symbol used in the command line area that shows your active key combo separator = "➜", -- symbol used between a key and it's label group = "+", -- symbol prepended to a group }, popup_mappings = { scroll_down = '', -- binding to scroll down inside the popup scroll_up = '', -- binding to scroll up inside the popup }, window = { border = "none", -- none, single, double, shadow position = "bottom", -- bottom, top margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left] padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left] winblend = 0 }, layout = { height = { min = 4, max = 25 }, -- min and max height of the columns width = { min = 20, max = 50 }, -- min and max width of the columns spacing = 3, -- spacing between columns align = "left", -- align columns left, center or right }, ignore_missing = false, -- enable this to hide mappings for which you didn't specify a label hidden = { "", "", "", "", "call", "lua", "^:", "^ "}, -- hide mapping boilerplate show_help = true, -- show help message on the command line when the popup is visible triggers = "auto", -- automatically setup triggers -- triggers = {""} -- or specify a list manually triggers_blacklist = { -- list of mode / prefixes that should never be hooked by WhichKey -- this is mostly relevant for key maps that start with a native binding -- most people should not need to change this i = { "j", "k" }, v = { "j", "k" }, }, } EOF " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ Comment ║ " ╚════════════════════════════════════════════════════════════════════════════╝ lua << EOF require('Comment').setup({ ---Add a space b/w comment and the line padding = true, ---Whether the cursor should stay at its position sticky = true, ---Lines to be ignored while (un)comment ignore = nil, ---LHS of toggle mappings in NORMAL mode toggler = { ---Line-comment toggle keymap line = 'gcc', ---Block-comment toggle keymap block = 'gbc', }, ---LHS of operator-pending mappings in NORMAL and VISUAL mode opleader = { ---Line-comment keymap line = 'gc', ---Block-comment keymap block = 'gb', }, ---LHS of extra mappings extra = { ---Add comment on the line above above = 'gcO', ---Add comment on the line below below = 'gco', ---Add comment at the end of line eol = 'gcA', }, ---Enable keybindings mappings = { ---Operator-pending mapping; ---`gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}` basic = true, ---Extra mapping; ---`gco`, `gcO`, `gcA` extra = true, ---Extended mapping; ---`g>` `g<` `g>[count]{motion}` `g<[count]{motion}` extended = false, }, ---Function to call before (un)comment pre_hook = nil, ---Function to call after (un)comment post_hook = nil, }) EOF nmap gcc vmap gc " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ Reader ║ " ╚════════════════════════════════════════════════════════════════════════════╝ function s:vertopen_url() normal! "uyiW let mycommand = "reader " . @u execute "vertical terminal " . mycommand endfunction noremap vertopen_url : call vertopen_url() nmap gx vertopen_url " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ Custom commands ║ " ╚════════════════════════════════════════════════════════════════════════════╝ " Color picker vnoremap c=system('yad --color --init-color' . shellescape(@")) nnoremap :put =system('yad --color') inoremap :put =system('yad --color') " ╔════════════════════════════════════════════════════════════════════════════╗ " ║ Custom replacements ║ " ╚════════════════════════════════════════════════════════════════════════════╝ nnoremap dt"h"=strftime('%Y-%m-%dT%H:%M:%S%z')p inoremap =strftime('%Y-%m-%dT%H:%M:%S%z') inoreabbrev mariusu マリウス inoreabbrev mariusucom xn--gckvb8fzb.com