diff --git a/editorconfig b/editorconfig index d1272daa..7344b8c1 100644 --- a/editorconfig +++ b/editorconfig @@ -8,8 +8,11 @@ insert_final_newline = true indent_style = space indent_size = 2 -[*.{php,css,scss,sass,js,json,json5,jsx,ts,tsx,html,twig,yml,svg,lua}] +[*.{php,css,scss,sass,js,json,json5,jsx,ts,tsx,html,twig,yml,yaml,svg,lua}] trim_trailing_whitespace = true [*.{md,markdown,rst,txt,csv,snip,mail}] trim_trailing_whitespace = false + +[neomutt-*] +trim_trailing_whitespace = false diff --git a/install/3_vimux.sh b/install/3_vimux.sh index 1a65e28c..ef248ec5 100755 --- a/install/3_vimux.sh +++ b/install/3_vimux.sh @@ -8,8 +8,9 @@ pip install neovim ln -s ~/dotfiles/nvim ~/.config/nvim # additional language-servers for nvim-lspconfig -npm install -g eslint_d npm install -g fixjson +npm install -g eslint_d +npm install -g jsonlint npm install -g markdownlint-cli npm install -g neovim npm install -g stylelint diff --git a/nvim/ftplugin/css.lua b/nvim/ftplugin/css.lua deleted file mode 100644 index 263e12f4..00000000 --- a/nvim/ftplugin/css.lua +++ /dev/null @@ -1,3 +0,0 @@ -local setlocal = vim.opt_local - -setlocal.iskeyword:append('-') diff --git a/nvim/ftplugin/json.lua b/nvim/ftplugin/json.lua deleted file mode 100644 index 263e12f4..00000000 --- a/nvim/ftplugin/json.lua +++ /dev/null @@ -1,3 +0,0 @@ -local setlocal = vim.opt_local - -setlocal.iskeyword:append('-') diff --git a/nvim/ftplugin/json5.lua b/nvim/ftplugin/json5.lua deleted file mode 100644 index 263e12f4..00000000 --- a/nvim/ftplugin/json5.lua +++ /dev/null @@ -1,3 +0,0 @@ -local setlocal = vim.opt_local - -setlocal.iskeyword:append('-') diff --git a/nvim/ftplugin/mail.lua b/nvim/ftplugin/mail.lua deleted file mode 100644 index 11af66f3..00000000 --- a/nvim/ftplugin/mail.lua +++ /dev/null @@ -1,8 +0,0 @@ -local setlocal = vim.opt_local - -setlocal.comments:append('nb:>') -setlocal.formatoptions:append('awq') -setlocal.spell = true -setlocal.spelllang = { 'de', 'en' } -setlocal.wrap = true -setlocal.textwidth = 70 diff --git a/nvim/ftplugin/markdown.lua b/nvim/ftplugin/markdown.lua deleted file mode 100644 index 992224c9..00000000 --- a/nvim/ftplugin/markdown.lua +++ /dev/null @@ -1,7 +0,0 @@ -local setlocal = vim.opt_local - -setlocal.spell = true -setlocal.spelllang = { 'de', 'en' } -setlocal.wrap = true -setlocal.textwidth = 70 -setlocal.formatoptions:append('q') diff --git a/nvim/ftplugin/scss.lua b/nvim/ftplugin/scss.lua deleted file mode 100644 index 263e12f4..00000000 --- a/nvim/ftplugin/scss.lua +++ /dev/null @@ -1,3 +0,0 @@ -local setlocal = vim.opt_local - -setlocal.iskeyword:append('-') diff --git a/nvim/lua/autocommands.lua b/nvim/lua/autocommands.lua index ad465a01..d3bf4f16 100644 --- a/nvim/lua/autocommands.lua +++ b/nvim/lua/autocommands.lua @@ -1,16 +1,39 @@ -local cmd = vim.cmd +local setlocal = vim.opt_local +local create = vim.api.nvim_create_autocmd -cmd([[ - augroup init - autocmd! +vim.cmd([[ + " Remember last location/cursor in file + autocmd BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g'\"" | endif - " Remember last location/cursor in file - autocmd BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g'\"" | endif + " Autoresize windows/splits when vim resizes + autocmd VimResized * wincmd = +]]) - " Autoresize windows/splits when vim resizes - autocmd VimResized * wincmd = +-- make dash-spearated-key"ords on "word" in vim +create({ 'BufEnter', 'BufWinEnter' }, { + pattern = { '*.css', '*.scss', '*.json' }, + callback = function() setlocal.iskeyword:append('-') end, +}) + +-- filetype-specific settings for text-files +create({ 'BufEnter', 'BufWinEnter' }, { + pattern = { '*.md', '*.markdown', '*.rst', '*.txt', 'neomutt-*', '*.mail' }, + callback = function() + setlocal.spell = true + setlocal.spelllang = { 'de', 'en' } + setlocal.wrap = true + setlocal.textwidth = 70 + setlocal.formatoptions:append('q') + end, +}) + +-- filetype-specific settings for mails +create({ 'BufEnter', 'BufWinEnter' }, { + pattern = { 'neomutt-*', '*.mail' }, + callback = function() + setlocal.filetype = 'mail' + setlocal.comments:append('nb:>') + setlocal.formatoptions:append('aw') + end, +}) - " When opening temporary mails in mutt, automatically set filetype to mail - autocmd BufNewFile,BufRead neomutt-* set ft=mail - augroup END -]]) diff --git a/nvim/lua/config/colorizer.lua b/nvim/lua/config/colorizer.lua new file mode 100644 index 00000000..b4deacb3 --- /dev/null +++ b/nvim/lua/config/colorizer.lua @@ -0,0 +1,7 @@ +require('colorizer').setup({ + css = { css = true }, + scss = { css = true }, + json = { css = true}, + json5 = { css = true, }, + javascript = { css = true }, +}) diff --git a/nvim/lua/config/lint.lua b/nvim/lua/config/lint.lua new file mode 100644 index 00000000..fb97620e --- /dev/null +++ b/nvim/lua/config/lint.lua @@ -0,0 +1,26 @@ +require('lint').linters_by_ft = { + markdown = { 'markdownlint' }, + php = { 'php' }, + yaml = { 'yamllint' }, + css = { 'stylelint' }, + scss = { 'stylelint' }, + json = { 'fixjson' }, + javascript = { 'eslint_d' }, + javascriptreact = { 'eslint_d' }, + typescript = { 'tsc', 'eslint_d' }, + typescriptreact = { 'tsc', 'eslint_d' }, +} + +vim.api.nvim_create_autocmd({ 'BufWritePost' }, { + pattern = { + '*.js', '*.ts', '*.jsx', '*.tsx', + '*.yml', '*.yaml', + '*.md', '*.markdown', + '*.php', + '*.css', '*.scss', + '*.json', + }, + callback = function() + require('lint').try_lint() + end, +}) diff --git a/nvim/lua/config/lualine.lua b/nvim/lua/config/lualine.lua new file mode 100644 index 00000000..6291ef97 --- /dev/null +++ b/nvim/lua/config/lualine.lua @@ -0,0 +1,10 @@ +require('lualine').setup({ + sections = { + lualine_b = { 'branch' }, + lualine_x = {}, + lualine_y = { 'diff', 'diagnostics' }, + }, + options = { + theme = 'gruvbox' + }, +}) diff --git a/nvim/lua/config/neorg.lua b/nvim/lua/config/neorg.lua new file mode 100644 index 00000000..6af61a3f --- /dev/null +++ b/nvim/lua/config/neorg.lua @@ -0,0 +1,14 @@ +require('neorg').setup({ + load = { + ['core.concealer'] = {}, + ['core.defaults'] = {}, + ['core.dirman'] = { + config = { + default_workspace = 'notes', + workspaces = { + notes = '~/Notes', + }, + }, + }, + }, +}) diff --git a/nvim/lua/config/null-ls.lua b/nvim/lua/config/null-ls.lua index 0e5db563..10fa1243 100644 --- a/nvim/lua/config/null-ls.lua +++ b/nvim/lua/config/null-ls.lua @@ -4,23 +4,10 @@ local b = null_ls.builtins -- register any number of sources simultaneously local sources = { -- js and friends via eslint_d - b.diagnostics.eslint_d, b.formatting.eslint_d, - b.code_actions.eslint_d, - - -- css and scss-files - b.diagnostics.stylelint.with({ prefer_local = 'node_modules/.bin' }), b.formatting.stylelint.with({ prefer_local = 'node_modules/.bin' }), - - -- markdown - b.diagnostics.markdownlint, b.formatting.markdownlint, - - -- other languages - b.diagnostics.php, - b.diagnostics.tsc, - b.diagnostics.yamllint, - b.formatting.fixjson, + b.code_actions.eslint_d, } null_ls.setup({ diff --git a/nvim/lua/config/zen-mode.lua b/nvim/lua/config/zen-mode.lua new file mode 100644 index 00000000..fb3fe703 --- /dev/null +++ b/nvim/lua/config/zen-mode.lua @@ -0,0 +1,10 @@ +require('zen-mode').setup({ + window = { + backdrop = 0.95, + width = 120, + height = 0.85, + }, + plugins = { + gitsigns = { enabled = true }, + }, +}) diff --git a/nvim/lua/mappings.lua b/nvim/lua/mappings.lua index 08d21332..3c7066ca 100644 --- a/nvim/lua/mappings.lua +++ b/nvim/lua/mappings.lua @@ -7,103 +7,100 @@ local map = function(mode, lhs, rhs, opts) })) end --- remap semi-colon to be colon in normal an visual mode -map('n', ';', ':') -map('v', ';', ':') - --- deactivate ex-mode and man-pages -map('n', 'Q', '') -map('n', 'K', '') - --- keeping it centered when search/jumping to next/prev entry -map('n', 'n', 'nzzzv') -map('n', 'N', 'Nzzzv') - --- j and k for wrapped lines -map('n', 'j', 'gj') -map('n', 'k', 'gk') - --- captial Y to yank till line end in normal mode -map('n', 'Y', 'y$') - --- Swap v and CTRL-V, because Block mode is more useful -map('n', 'v', '') -map('n', '', 'v') -map('v', 'v', '') -map('v', '', 'v') +local wk = require('which-key') + +wk.register({ + ['-'] = { 'FloatermNew nnn', 'invoke floaterm with nnn as file picker' }, + [';'] = { ':', 'Colon with semicolon' }, + [''] = { 'checktimeredraw!', 'redraw/reload with F5' }, + [''] = { 'bfirst', 'buffer navigation with arrow keys' }, + [''] = { 'bnext', 'buffer navigation with arrow keys' }, + [''] = { 'blast', 'buffer navigation with arrow keys' }, + [''] = { 'bprevious', 'buffer navigation with arrow keys' }, + + g = { + b = { 'Gitsigns blame_line', '' }, + f = { 'execute "/\\v^[<\\|=>]{7}/"', '' }, + d = { 'lua vim.lsp.buf.definition()', 'show/go to definition' }, + i = { 'lua vim.lsp.buf.implementation()', 'show/go to implementation' }, + r = { 'lua vim.lsp.buf.references()', 'show/go to referennces' }, + }, + + K = { '', 'K man-pages mapping removed' }, + j = { 'gj', 'j and k with wrapped lines' }, + k = { 'gk', 'j and k with wrapped lines' }, + n = { 'nzzzv', 'kepping it centered with n' }, + v = { '', 'remapping visual/visual-block mode' }, + s = { function() require('flash').jump() end, 'flash jump' }, + N = { 'Nzzzv', 'kepping it centered with N' }, + Q = { '', 'Q ex-mode-mapping removed' }, + S = { function() require('flash').treesitter() end, 'flash treesitter select' }, + Y = { 'y$', 'yank till end of line with Y'}, + + -- all normal mode leader key mappings in one place + [''] = { + [','] = { 'Telescope find_files', '' }, + ['-'] = { 'sj', '' }, + ['.'] = { 'Telescope buffers', '' }, + ['/'] = { 'Telescope search_history', '' }, + [';'] = { 'Telescope command_history', '' }, + ['\''] = { 'Telescope git_files', '' }, + ['\\'] = { 'vl', '' }, + [']'] = { 'Telescope current_buffer_fuzzy_find', '' }, + a = { 'Telescope live_grep', '' }, + b = { 'Telescope git_branches', '' }, + c = { 'Telescope git_bcommits', '' }, + d = { 'lua vim.lsp.buf.declaration()', '' }, + e = { 'lua vim.diagnostic.goto_next()', '' }, + f = { 'lua vim.lsp.buf.formatting()', '' }, + h = { 'lua vim.lsp.buf.hover()', '' }, + r = { 'lua vim.lsp.buf.rename()', '' }, + x = { 'lua vim.lsp.buf.code_action()', '' }, + l = { 'FloatermNew lazygit', '' }, + t = { 'FloatermNew', '' }, + v = { + ve = { 'e $MYVIMRC', '' }, + vr = { 'source $MYVIMRC', '' }, + }, + w = { 'set wrap! wrap?', '' }, + }, + + -- with as modifier + [''] = { 'NavigatorLeft', '' }, + [''] = { 'NavigatorDown', '' }, + [''] = { 'NavigatorUp', '' }, + [''] = { 'NavigatorRight', '' }, + [''] = { 'v', '' }, + + -- with as modifier + [''] = { ':move .-2', 'bubbling lines with alt-hjkl', noremap = false }, + [''] = { ':move .+1', 'bubbling lines with alt-hjkl', noremap = false }, + [''] = { '<<', 'bubbling lines with alt-hjkl', noremap = false }, + [''] = { '>>', 'bubbling lines with alt-hjkl', noremap = false }, +}) + +-- non-normal-mode mappings +wk.register({ + [';'] = { ':', 'Colon with semicolon' }, + v = { '', 'remapping visual/visual-block mode', }, + + -- with as modifier + [''] = { 'v', 'remapping visual/visual-block mode' }, + + -- with as modifier + [''] = { ":move '<-2gv", 'bubbling lines with alt-hjkl', noremap = false }, + [''] = { ":move '>+1gv", 'bubbling lines with alt-hjkl', noremap = false }, + [''] = { ''] = { '>gv', 'bubbling lines with alt-hjkl', noremap = false }, +}, { mode = 'v' }) + +wk.register({ + [''] = { 'vsnip#available(-1) ? "(vsnip-jump-prev)" : ""', 'snippet expansion' }, +}, { mode = 's', expr = true, noremap = true }) -- add undo-repo-breakpoints automatically when writing long text -map('i', ',', ',u') -map('i', '.', '.u') -map('i', '!', '!u') -map('i', '?', '?u') - --- bubbling of lines/selections with alt + hjkl -map('n', '', ':move .-2', { noremap = false }) -map('n', '', ':move .+1', { noremap = false }) -map('n', '', '<<', { noremap = false }) -map('n', '', '>>', { noremap = false }) -map('v', '', ":move '<-2gv", { noremap = false }) -map('v', '', ":move '>+1gv", { noremap = false }) -map('v', '', '', '>gv', { noremap = false }) - --- use the arrowkeys for usefull stuff in normal mode -- switching buffers -map('n', '', 'bfirst') -map('n', '', 'blast') -map('n', '', 'bp') -map('n', '', 'bn') - --- easieser splits -map('n', '\\', 'vl') -map('n', '-', 'sj') - --- Telescope -map('n', '\'', 'Telescope git_files') -map('n', ',', 'Telescope find_files') -map('n', '.', 'Telescope buffers') -map('n', '/', 'Telescope search_history') -map('n', ';', 'Telescope command_history') -map('n', 'a', 'Telescope live_grep') -map('n', 'b', 'Telescope git_branches') -map('n', 'c', 'Telescope git_bcommits') -map('n', ']', 'Telescope current_buffer_fuzzy_find') - --- lsp and diagnostics -map('n', 'gd', 'lua vim.lsp.buf.definition()') -map('n', 'gi', 'lua vim.lsp.buf.implementation()') -map('n', 'gr', 'lua vim.lsp.buf.references()') -map('n', 'd', 'lua vim.lsp.buf.declaration()') -map('n', 'e', 'lua vim.diagnostic.goto_next()') -map('n', 'f', 'lua vim.lsp.buf.formatting()') -map('n', 'h', 'lua vim.lsp.buf.hover()') -map('n', 'r', 'lua vim.lsp.buf.rename()') -map('n', 'x', 'lua vim.lsp.buf.code_action()') - --- git -map('n', 'l', 'FloatermNew lazygit') -map('n', 'gb', 'Gitsigns blame_line') -map('n', 'gf', "execute '/\\v^[<\\|=>]{7}/'") - --- floaterm -map('n', '-', 'FloatermNew nnn') -map('n', 't', 'FloatermNew') - --- vsnip snippets expansion -map('i', '', 'vsnip#available(1) ? "(vsnip-expand-or-jump)" : ""', { expr = true, noremap = false }) -map('s', '', 'vsnip#available(-1) ? "(vsnip-jump-prev)" : ""', { expr = true, noremap = false }) - --- other useful mappings -map('n', '', 'checktimeredraw!'); -map('n', 've', 'e $MYVIMRC') -map('n', 'vr', 'source $MYVIMRC') -map('n', 'w', 'set wrap! wrap?') - --- Navigator.nvim -map('n', '', 'NavigatorLeft') -map('n', '', 'NavigatorDown') -map('n', '', 'NavigatorUp') -map('n', '', 'NavigatorRight') - --- FTerm.nvim --- map('n', '-', 'lua require("FTerm").run("nnn")') +-- TODO only for prose (mail md etc) +-- map('i', ',', ',u') +-- map('i', '.', '.u') +-- map('i', '!', '!u') +-- map('i', '?', '?u') diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua index 144807ee..26dd1337 100644 --- a/nvim/lua/options.lua +++ b/nvim/lua/options.lua @@ -1,56 +1,46 @@ -local set = vim.opt -local cmd = vim.cmd -local g = vim.g - --- deactivate some unneeded language providers -g.loaded_python_provider = 0 -g.loaded_perl_provider = 0 - --- general options -set.breakindent = true -set.clipboard = 'unnamedplus' -set.cmdheight = 1 -set.completeopt = { 'menu', 'menuone', 'noselect' } -set.conceallevel = 2 -set.cpoptions:append('$') -set.cursorline = true -set.foldexpr = 'nvim_treesitter#foldexpr()' -set.foldmethod = 'expr' -set.gdefault = true -set.grepprg = 'rg' -set.hidden = true -set.ignorecase = true -set.infercase = true -set.laststatus = 3 -set.lazyredraw = true -set.list = true -set.listchars = 'extends:»,precedes:«,tab:▸ ,trail:·' -set.foldenable = false -set.showmode = false -set.swapfile = false -set.wrap = false -set.writebackup = false -set.relativenumber = true -set.scrolljump = 5 -set.scrolloff = 3 -set.shiftround = true -set.shiftwidth = 2 -set.shortmess:append('c') -set.showbreak = '\\\\\\\\' -set.showmatch = true -set.sidescroll = 10 -set.sidescrolloff = 5 -set.smartcase = true -set.splitright = true -set.splitbelow = true -set.updatetime = 300 -set.virtualedit = 'all' -set.visualbell = true -set.wildmode = { 'list:longest', 'list:full' } +vim.opt.breakindent = true +vim.opt.clipboard = 'unnamedplus' +vim.opt.cmdheight = 1 +vim.opt.completeopt = { 'menu', 'menuone', 'noselect' } +vim.opt.conceallevel = 2 +vim.opt.cpoptions:append('$') +vim.opt.cursorline = true +vim.opt.foldexpr = 'nvim_treesitter#foldexpr()' +vim.opt.foldmethod = 'expr' +vim.opt.gdefault = true +vim.opt.grepprg = 'rg' +vim.opt.hidden = true +vim.opt.ignorecase = true +vim.opt.infercase = true +vim.opt.laststatus = 3 +vim.opt.lazyredraw = true +vim.opt.list = true +vim.opt.listchars = 'extends:»,precedes:«,tab:▸ ,trail:·' +vim.opt.foldenable = false +vim.opt.showmode = false +vim.opt.swapfile = false +vim.opt.wrap = false +vim.opt.writebackup = false +vim.opt.relativenumber = true +vim.opt.scrolljump = 5 +vim.opt.scrolloff = 3 +vim.opt.shiftround = true +vim.opt.shiftwidth = 2 +vim.opt.shortmess:append('c') +vim.opt.showbreak = '\\\\\\\\' +vim.opt.showmatch = true +vim.opt.sidescroll = 10 +vim.opt.sidescrolloff = 5 +vim.opt.smartcase = true +vim.opt.splitright = true +vim.opt.splitbelow = true +vim.opt.timeoutlen = 300 +vim.opt.updatetime = 300 +vim.opt.virtualedit = 'all' +vim.opt.visualbell = true +vim.opt.wildmode = { 'list:longest', 'list:full' } -- colorscheme and default language -set.background = 'dark' -set.termguicolors = true -g.gruvbox_baby_telescope_theme = 1 -cmd 'colorscheme gruvbox-baby' -cmd 'language en_US.UTF-8' +vim.g.gruvbox_baby_telescope_theme = 1 +vim.cmd 'colorscheme gruvbox-baby' +vim.cmd 'language en_US.UTF-8' diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index af7b9898..4f6f22db 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -3,38 +3,35 @@ local function get_config (key) return function() require('config/' .. key) end end --- ensure folke/lazy.nvim is being loaded local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' if not vim.loop.fs_stat(lazypath) then vim.fn.system({ 'git', 'clone', '--filter=blob:none', 'https://github.com/folke/lazy.nvim.git', '--branch=stable', lazypath }) end -vim.opt.rtp:prepend(lazypath) --- Make sure to set mapleader before lazy.nvim so your mappings are correct +-- minimum starter options and settings before loading plugins vim.api.nvim_set_keymap('n', '', '', {}) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' +vim.g.loaded_python_provider = 0 +vim.g.loaded_perl_provider = 0 +vim.opt.rtp:prepend(lazypath) +vim.opt.background = 'dark' +vim.opt.termguicolors = true require('lazy').setup({ -- The colorscheme of choice { 'luisiacc/gruvbox-baby', priority = 1000 }, - -- modern neovim with treesitter + refactor/objects, lsp, - -- floaterm-integration (nnn, lazygit...) - -- telescope and cmp as completion engine, vsnip-support - { 'voldikss/vim-floaterm', init = get_config('floaterm') }, - { 'nvim-treesitter/nvim-treesitter', init = get_config('treesitter'), build = ':TSUpdate' }, - { 'nvim-treesitter/nvim-treesitter-textobjects', dependencies = { 'nvim-treesitter/nvim-treesitter' } }, - { 'nvim-treesitter/nvim-treesitter-refactor', dependencies = { 'nvim-treesitter/nvim-treesitter' } }, - - { 'neovim/nvim-lspconfig', init = get_config('lspconfig') }, - { 'nvim-telescope/telescope.nvim', init = get_config('telescope'), dependencies = { 'nvim-lua/plenary.nvim' } }, + -- modern neovim with treesitter, lsp, cmp, vsnips and telescope + { 'neovim/nvim-lspconfig', config = get_config('lspconfig') }, + { 'nvim-treesitter/nvim-treesitter', config = get_config('treesitter'), build = ':TSUpdate' }, + { 'nvim-treesitter/nvim-treesitter-textobjects', dependencies = 'nvim-treesitter/nvim-treesitter' }, + { 'nvim-treesitter/nvim-treesitter-refactor', dependencies = 'nvim-treesitter/nvim-treesitter' }, + { 'nvim-telescope/telescope.nvim', dependencies = 'nvim-lua/plenary.nvim', config = get_config('telescope') }, { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, - { 'hrsh7th/vim-vsnip', init = get_config('vsnip') }, - { 'rafamadriz/friendly-snippets', dependencies = { 'hrsh7th/vim-vsnip' } }, - { - 'hrsh7th/nvim-cmp', - init = get_config('cmp'), + { 'hrsh7th/vim-vsnip', config = get_config('vsnip') }, + { 'rafamadriz/friendly-snippets', dependencies = 'hrsh7th/vim-vsnip' }, + { 'hrsh7th/nvim-cmp', dependencies = { 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-cmdline', @@ -43,109 +40,44 @@ require('lazy').setup({ 'hrsh7th/cmp-path', 'hrsh7th/cmp-vsnip', }, + config = get_config('cmp'), }, - -- TODO replace null-ls with nvim-lint - { 'jose-elias-alvarez/null-ls.nvim', init = get_config('null-ls'), dependencies = { 'nvim-lua/plenary.nvim' } }, - + -- interface enhancements + { 'folke/which-key.nvim', event = 'VeryLazy', config = true }, + { 'folke/zen-mode.nvim', dependencies = 'folke/twilight.nvim', config = get_config('zen-mode') }, + { 'kevinhwang91/nvim-bqf', config = true }, + { 'lewis6991/gitsigns.nvim', config = true }, + { 'norcalli/nvim-colorizer.lua', event = 'BufReadPre', config = get_config('colorizer') }, + { 'nvim-lualine/lualine.nvim', dependencies = 'nvim-tree/nvim-web-devicons', config = get_config('lualine') }, - -- editing / moving enhancements + -- editing / movement enhancements { 'AndrewRadev/splitjoin.vim' }, + { 'folke/flash.nvim', event = 'VeryLazy', config = true }, + { 'kylechui/nvim-surround', event = 'VeryLazy', config = true }, { 'numToStr/Comment.nvim', config = true }, { 'numToStr/Navigator.nvim', config = true }, - { 'tpope/vim-ragtag' }, - { 'tpope/vim-repeat' }, + { 'tpope/vim-ragtag' }, -- TODO still needed?! + { 'tpope/vim-repeat' }, -- TODO still needed?! { 'windwp/nvim-autopairs', event = 'InsertEnter', config = true }, - { 'kylechui/nvim-surround', event = 'VeryLazy', config = true }, - { - 'folke/flash.nvim', - event = 'VeryLazy', - -- TODO use whichkey for key mappings everywhere, one single init.lua ?! - keys = { - { 's', mode = { 'n', 'o', 'x' }, function() require('flash').jump() end, desc = 'Flash' }, - { 'S', mode = { 'n', 'o', 'x' }, function() require('flash').treesitter() end, desc = 'Flash Treesitter' }, - }, - }, - -- interface/code-navigation enhancements, git and others - { 'lewis6991/gitsigns.nvim', config = true }, - { 'kevinhwang91/nvim-bqf', config = true }, - { 'nvim-lualine/lualine.nvim', - dependencies = { 'nvim-tree/nvim-web-devicons' }, - opts = { - sections = { - lualine_b = { 'branch' }, - lualine_x = {}, - lualine_y = { 'diff', 'diagnostics' }, - }, - options = { - theme = 'gruvbox' - } - }, - }, - { 'norcalli/nvim-colorizer.lua', - event = 'BufReadPre', - opts = { - css = { css = true }, - scss = { css = true }, - json = { css = true}, - json5 = { css = true, }, - javascript = { css = true }, - }, - }, - - -- and neorg for todo-lists etc. - { - 'nvim-neorg/neorg', + -- more plugins and integrations + { 'voldikss/vim-floaterm', config = get_config('floaterm') }, + { 'mfussenegger/nvim-lint', config = get_config('lint') }, + -- TODO replace null-ls with formatter ?! + { 'jose-elias-alvarez/null-ls.nvim', config = get_config('null-ls'), dependencies = 'nvim-lua/plenary.nvim' }, + { 'nvim-neorg/neorg', build = ':Neorg sync-parsers', - opts = { - load = { - ['core.concealer'] = {}, - ['core.defaults'] = {}, - ['core.dirman'] = { - config = { - default_workspace = 'notes', - workspaces = { - notes = '~/Notes', - }, - }, - }, - }, - }, - dependencies = { { 'nvim-lua/plenary.nvim' } }, + dependencies = 'nvim-lua/plenary.nvim', + config = get_config('neorg'), }, - - -- investigating... - { - 'jackMort/ChatGPT.nvim', + { 'jackMort/ChatGPT.nvim', event = 'VeryLazy', - config = true, dependencies = { 'MunifTanjim/nui.nvim', 'nvim-lua/plenary.nvim', 'nvim-telescope/telescope.nvim' - } - }, - { - 'folke/zen-mode.nvim', - dependencies = { 'folke/twilight.nvim' }, - opts = { - window = { - backdrop = 0.95, - width = 120, - height = 0.85, - }, - plugins = { - gitsigns = { enabled = true }, - }, }, - }, - { - 'folke/which-key.nvim', - event = 'VeryLazy', - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 300 - end, + config = true, }, })