diff options
Diffstat (limited to '.config/nvim/lua')
-rwxr-xr-x | .config/nvim/lua/plugins/aerial.lua | 4 | ||||
-rwxr-xr-x | .config/nvim/lua/plugins/cmp.lua | 2 | ||||
-rwxr-xr-x | .config/nvim/lua/plugins/indent-o-matic.lua | 9 | ||||
-rwxr-xr-x | .config/nvim/lua/plugins/init.lua | 16 | ||||
-rwxr-xr-x | .config/nvim/lua/plugins/leap.lua | 1 | ||||
-rwxr-xr-x | .config/nvim/lua/plugins/lspconfig.lua | 9 | ||||
-rwxr-xr-x | .config/nvim/lua/plugins/null-ls.lua | 12 | ||||
-rwxr-xr-x | .config/nvim/lua/plugins/telescope.lua | 9 | ||||
-rwxr-xr-x | .config/nvim/lua/settings.lua | 24 | ||||
-rwxr-xr-x | .config/nvim/lua/statusline.lua | 8 |
10 files changed, 69 insertions, 25 deletions
diff --git a/.config/nvim/lua/plugins/aerial.lua b/.config/nvim/lua/plugins/aerial.lua index 7b915db..2ae77bf 100755 --- a/.config/nvim/lua/plugins/aerial.lua +++ b/.config/nvim/lua/plugins/aerial.lua @@ -1,6 +1,8 @@ require("aerial").setup{ highlight_on_jump = 800, - min_width = 10, + layout = { + min_width = 10, + }, filter_kind = { "Array", "Boolean", diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua index 503440f..8f9dae2 100755 --- a/.config/nvim/lua/plugins/cmp.lua +++ b/.config/nvim/lua/plugins/cmp.lua @@ -10,7 +10,7 @@ cmp.setup({ }, sources = cmp.config.sources({ { name = 'nvim_lsp' }, - { name = 'cmdline' }, + -- { name = 'cmdline' }, { name = 'path' }, { name = 'calc' } }, diff --git a/.config/nvim/lua/plugins/indent-o-matic.lua b/.config/nvim/lua/plugins/indent-o-matic.lua index 4b2abb5..517c3d8 100755 --- a/.config/nvim/lua/plugins/indent-o-matic.lua +++ b/.config/nvim/lua/plugins/indent-o-matic.lua @@ -5,10 +5,15 @@ require('indent-o-matic').setup { filetype_ = { standard_widths = { 2, 4 } }, filetype_css = { max_lines = 4096 }, - filetype_scss = { max_lines = 4096 }, - filetype_json = { max_lines = 4096 }, + filetype_django = { max_lines = 4096 }, filetype_javascript = { max_lines = 4096 }, + filetype_json = { max_lines = 4096 }, + filetype_lua = { max_lines = 4096 }, + filetype_scss = { max_lines = 4096 }, filetype_typescript = { max_lines = 4096 }, filetype_xml = { max_lines = 4096 }, filetype_django = { max_lines = 4096 }, + filetype_toml = { max_lines = 4096 }, + filetype_yaml = { max_lines = 4096 }, + filetype_jsonnet = { max_lines = 4096 }, } diff --git a/.config/nvim/lua/plugins/init.lua b/.config/nvim/lua/plugins/init.lua index cd325d2..9878222 100755 --- a/.config/nvim/lua/plugins/init.lua +++ b/.config/nvim/lua/plugins/init.lua @@ -35,7 +35,16 @@ require('paq') { -- vim.fn.system({'python3', '-m', 'pip', 'install', '--force', 'debugpy'}) end }; - {'mickael-menu/zk-nvim'}; + -- {'mickael-menu/zk-nvim'}; + { + 'jose-elias-alvarez/null-ls.nvim', + run = function() + vim.fn.system({'npm', 'install', '-g', 'markdownlint'}) + vim.fn.system({'python3', '-m', 'pip', 'install', 'gitlint'}) + vim.fn.system({'python3', '-m', 'pipx', 'install', 'yamllint'}) + vim.fn.system({'luarocks', 'install', 'luacheck'}) + end +}; {'nvim-telescope/telescope.nvim'}; {'stevearc/aerial.nvim'}; @@ -80,14 +89,15 @@ require('paq') { require('plugins.aerial') require('plugins.bufresize') require('plugins.cmp') --- require('plugins.dap') +require('plugins.dap') require('plugins.diffview') require('plugins.gitsigns') require('plugins.indent-guides') require('plugins.indent-o-matic') require('plugins.sniprun') require('plugins.lspconfig') +require('plugins.null-ls') require('plugins.telescope') require('plugins.treesitter') require('plugins.which-key') -require('plugins.zk') +-- require('plugins.zk') diff --git a/.config/nvim/lua/plugins/leap.lua b/.config/nvim/lua/plugins/leap.lua new file mode 100755 index 0000000..c0aeeef --- /dev/null +++ b/.config/nvim/lua/plugins/leap.lua @@ -0,0 +1 @@ +require('leap').add_default_mappings() diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua index 9ef6a1d..6d37467 100755 --- a/.config/nvim/lua/plugins/lspconfig.lua +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -22,8 +22,6 @@ local on_attach = function(client, bufnr) vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts) vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts) vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts) - - require("aerial").on_attach(client, bufnr) end vim.api.nvim_set_keymap('n', '<space>d', '<cmd>lua vim.diagnostic.open_float()<CR>', opts) @@ -31,7 +29,7 @@ vim.api.nvim_set_keymap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>', op vim.api.nvim_set_keymap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts) vim.api.nvim_set_keymap('n', '<space>q', '<cmd>lua vim.diagnostic.setloclist()<CR>', opts) -require('lspconfig').ansiblels.setup{ on_attach = on_attach } +-- require('lspconfig').ansiblels.setup{ on_attach = on_attach } require('lspconfig').clangd.setup{ on_attach = on_attach } require('lspconfig').eslint.setup{ on_attach = on_attach } require('lspconfig').gopls.setup{ on_attach = on_attach } @@ -58,7 +56,10 @@ require('lspconfig').pylsp.setup{ on_attach = on_attach, settings = { pylsp = { - configurationSources = {'flake8', 'pycodestyle'}, + configurationSources = { + 'flake8', + 'pycodestyle' + }, plugins = { flake8 = { enabled = true, diff --git a/.config/nvim/lua/plugins/null-ls.lua b/.config/nvim/lua/plugins/null-ls.lua new file mode 100755 index 0000000..3f84b26 --- /dev/null +++ b/.config/nvim/lua/plugins/null-ls.lua @@ -0,0 +1,12 @@ +require('null-ls').setup({ + sources = { + -- require('null-ls').builtins.diagnostics.ansiblelint, + -- require('null-ls').builtins.diagnostics.markdownlint, + require('null-ls').builtins.diagnostics.eslint, + require('null-ls').builtins.diagnostics.gitlint, + require('null-ls').builtins.diagnostics.luacheck, + require('null-ls').builtins.diagnostics.shellcheck, + require('null-ls').builtins.diagnostics.yamllint, + require('null-ls').builtins.formatting.stylua, + }, +}) diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 6a5f8c6..69dcbfd 100755 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -8,16 +8,19 @@ require('telescope').load_extension('aerial') local opt = { noremap=true } local keybinds = { + {'f/', 'current_buffer_fuzzy_find'}, {'fa', 'aerial'}, {'fb', 'buffers'}, {'ff', 'find_files'}, - {'fg', 'git_files'}, - {'fl', 'live_grep'}, + {'fgb', 'git_branches'}, + {'fgc', 'git_commits'}, + {'fgg', 'git_files'}, + {'fgs', 'git_status'}, {'fh', 'help_tags'}, + {'fl', 'live_grep'}, {'fm', 'man_pages'}, {'fo', 'oldfiles'}, {'fr', 'resume'}, - {'f/', 'current_buffer_fuzzy_find'}, } for _, keybind in pairs(keybinds) do diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index ef8fb95..eaa5617 100755 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -12,6 +12,8 @@ o.smarttab = true o.number = true o.list = true o.mouse = '' +o.backspace = 'indent,eol,start' + o.swapfile = false @@ -33,12 +35,7 @@ cmd 'filetype indent on' cmd 'colorscheme colorscheme' vim.cmd([[ - au BufNewFile,BufRead *.Dockerfile,Dockerfile.* setlocal filetype=dockerfile au BufNewFile,BufRead *.j2*,*.jinja* setlocal filetype=django - au BufNewFile,BufRead */task/config setlocal filetype=taskrc - au BufNewFile,BufRead *.env* setlocal filetype=sh - - au BufNewFile,BufRead */playbooks/*.yml set filetype=yaml.ansible au BufNewFile,BufRead */.config/neomutt/* \ if &filetype == "" | @@ -46,6 +43,23 @@ vim.cmd([[ \ endif ]]) +vim.filetype.add({ + pattern = { + ['.*playbooks/.*%.yml'] = 'yaml.ansible', + ['.*roles/.*/tasks/.*%.yml'] = 'yaml.ansible', + ['.*roles/.*/defaults/.*%.yml'] = 'yaml.ansible', + ['.*roles/.*/vars/.*%.yml'] = 'yaml.ansible', + ['.*roles/.*/meta/.*%.yml'] = 'yaml.ansible', + ['.*roles/.*/templates/.*%.yml'] = 'yaml.ansible', + ['.*%.Dockerfile'] = 'dockerfile', + ['Dockerfile%..*'] = 'dockerfile', + ['.*%.env.*'] = 'sh', + ['.*/task/config'] = 'taskrc', + ['%.ansible%-lint'] = 'yaml', + ['%.yamllint'] = 'yaml', + } +}) + --[[ require'nvim-treesitter.configs'.setup { textobjects = { diff --git a/.config/nvim/lua/statusline.lua b/.config/nvim/lua/statusline.lua index 099d930..c436a8e 100755 --- a/.config/nvim/lua/statusline.lua +++ b/.config/nvim/lua/statusline.lua @@ -1,7 +1,3 @@ ---[[ --- Statusline ---]] - local api = vim.api local cmd = vim.cmd local utils = require('utils') @@ -50,5 +46,5 @@ function get_statusline() end -- Enable statusline -utils.opt('o', 'laststatus', 2) -utils.opt('o', 'statusline', get_statusline()) +vim.o.lastatus = 2 +vim.o.statusline = get_statusline() |