diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..b9b3429 --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,2 @@ +require("plugins") +require("settings") diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim deleted file mode 100644 index f50e3a4..0000000 --- a/.config/nvim/init.vim +++ /dev/null @@ -1,35 +0,0 @@ -lua require("init") - -set title -set titlestring=%F%m\ %r\ %y - -function s:recompile_plugins() - luafile % - PackerCompile -endfunction - -"" Autocommands - -augroup recompile_plugins - autocmd! - autocmd BufWritePost plugins.lua call recompile_plugins() -augroup END - -autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab -autocmd BufRead,BufNewFile *.hcl set filetype=terraform -autocmd BufRead,BufNewFile *.tf set filetype=terraform - -"" Temporary hacks - -" Show syntax highlight group in the status bar -map ,H :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' -\ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" -\ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" - -function! SynGroup() - let l:s = synID(line('.'), col('.'), 1) - echo synIDattr(l:s, 'name') . ' -> ' . synIDattr(synIDtrans(l:s), 'name') -endfun -map ,J :call SynGroup() - -map ,L :luafile % diff --git a/.config/nvim/lua/dln/lsp-config.lua b/.config/nvim/lua/dln/lsp-config.lua index e17d107..e044260 100644 --- a/.config/nvim/lua/dln/lsp-config.lua +++ b/.config/nvim/lua/dln/lsp-config.lua @@ -2,6 +2,10 @@ local lspconfig = require("lspconfig") -- local configs = require("lspconfig.configs") local util = require("lspconfig.util") +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities) + + vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( vim.lsp.diagnostic.on_publish_diagnostics, @@ -81,11 +85,12 @@ local yaml_is_k8s = function(bufnr) end lspconfig.cssls.setup { - cmd = { "css-languageserver", "--stdio" }, - filetypes = { "css" }, - settings = {} + cmd = { "vscode-css-languageserver", "--stdio" }, + capabilities = capabilities, } +lspconfig.cssmodules_ls.setup{} + lspconfig.html.setup { cmd = { "vscode-html-languageserver", "--stdio" }, filetypes = { "html" }, diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 7b9fd43..9601b9a 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -6,10 +6,8 @@ return require('packer').startup(function() use 'ray-x/lsp_signature.nvim' use 'jose-elias-alvarez/nvim-lsp-ts-utils' use 'rafamadriz/friendly-snippets' - use 'mfussenegger/nvim-dap' - - use {'ray-x/guihua.lua', run = 'cd lua/fzy && make'} use { "rcarriga/nvim-dap-ui", requires = {"mfussenegger/nvim-dap"} } + use {'ray-x/guihua.lua', run = 'cd lua/fzy && make'} use { 'theHamsta/nvim-dap-virtual-text', @@ -20,6 +18,14 @@ return require('packer').startup(function() end } + use({ + "jose-elias-alvarez/null-ls.nvim", + requires = { "nvim-lua/plenary.nvim" }, + config = function() + require("plugins/null-ls") + end, + }) + use { 'b3nj5m1n/kommentary', config = function() @@ -234,9 +240,8 @@ return require('packer').startup(function() map('n', 'g?', 'lua require("telescope.builtin").lsp_workspace_symbols()') map('n', 'ge', 'lua require("telescope.builtin").lsp_document_diagnostics()') map('n', 'Db', 'lua require("telescope").extensions.dap.list_breakpoints()') - map('n', 'Dc', 'lua require("telescope").extensions.dap.commands()') + map('n', 'Dcc', 'lua require("telescope").extensions.dap.commands()') map('n', 'Df', 'lua require("telescope").extensions.dap.frames()') - map('n', 'DD', ':GoBreakToggle') map('n', 'Dv', 'lua require("telescope").extensions.dap.variables()') end } @@ -256,25 +261,13 @@ return require('packer').startup(function() end } - - use { - 'mattn/efm-langserver', - config = function() - require "lspconfig".efm.setup { - init_options = {documentFormatting = true}, - settings = { - } - } - end - } - use { "ray-x/go.nvim", config = function() require('go').setup({ comment_placeholder = '', icons = {breakpoint = '🧘', currentpos = '🏃'}, - dap_debug_gui = true + dap_debug_gui = false }) vim.cmd("autocmd FileType go nmap c :lua require('go.comment').gen()") vim.cmd("autocmd BufWritePre *.go :silent! lua require('go.format').gofmt()") @@ -296,6 +289,18 @@ return require('packer').startup(function() config = function() require("plugins/marks") end, } + -- dap + use { + 'mfussenegger/nvim-dap', + config = function() require("plugins/dap") end, + } + + -- go + use { + "leoluz/nvim-dap-go", + config = function() require("plugins/nvim-dap-go") end, + } + -- zenbones use { "mcchrish/zenbones.nvim", diff --git a/.config/nvim/lua/plugins/zenbones.lua b/.config/nvim/lua/plugins/zenbones.lua index 1d3a977..27ef678 100644 --- a/.config/nvim/lua/plugins/zenbones.lua +++ b/.config/nvim/lua/plugins/zenbones.lua @@ -15,7 +15,7 @@ local specs = lush.parse(function() CursorLine { bg = "#f5f5f0" }, CursorLineNr { fg = "#BCAAA4", bg="#f5f5f0" }, MsgArea { fg = "#A1887F", bg="#f1f1f1" }, - String { fg = "#33691E", gui = "italic" }, + String { fg = "#2E7D32", gui = "italic" }, Comment { fg = "#114499", gui = "bold,italic" }, LineNr { fg = "#CFD8DC", gui = "bold,italic" }, Indent1 { fg = "#FFEBEE", gui = "italic" }, diff --git a/.config/nvim/lua/init.lua b/.config/nvim/lua/settings.lua similarity index 83% rename from .config/nvim/lua/init.lua rename to .config/nvim/lua/settings.lua index 85ecb00..d28e919 100644 --- a/.config/nvim/lua/init.lua +++ b/.config/nvim/lua/settings.lua @@ -12,6 +12,8 @@ vim.o.updatetime = 100 vim.o.autochdir = true vim.o.backupdir = "/home/dln/.local/share/nvim/backup/" vim.o.backup = true +vim.g.netrw_dirhistmax = 0 +vim.o.clipboard = "unnamedplus" --- Indent vim.o.autoindent = true @@ -44,7 +46,7 @@ vim.o.completeopt = 'menuone,noinsert,noselect' --- Appearance vim.o.background = 'light' -vim.o.scrolloff = 8 +vim.o.scrolloff = 5 vim.o.showmode = false vim.o.sidescrolloff = 5 vim.o.termguicolors = true @@ -54,6 +56,10 @@ vim.wo.signcolumn = "yes" vim.o.laststatus = 0 vim.o.statusline = "═" vim.o.fillchars = "stl:═,stlnc:═" +vim.o.title = true +vim.o.titlestring = "%F%m %r %y" +vim.wo.foldmethod = "expr" +vim.wo.foldexpr = "nvim_treesitter#foldexpr()" --- Key mappings local map = require("dln.utils").map @@ -62,10 +68,11 @@ map('n', 'H', '^') map('n', 'L', '$') map('i', '', '') +map('n', ',L', ':luafile %') -- Reload lua file + --- Plugins vim.g.netrw_dirhistmax = 0 -require('plugins') local border = { {"🭽", "FloatBorder"}, @@ -80,8 +87,3 @@ local border = { vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = border }) vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {border = border }) - --- vim.cmd [[nnoremap :lua vim.lsp.diagnostic.show_line_diagnostics({ border = border })]] --- vim.cmd [[nnoremap ]g :lua vim.lsp.diagnostic.goto_next({ popup_opts = { border = border }})]] --- vim.cmd [[nnoremap [g :lua vim.lsp.diagnostic.goto_prev({ popup_opts = { border = "round" }})]] -