diff --git a/.config/nvim/lua/colorscheme.lua b/.config/nvim/lua/colorscheme.lua index bdc1fdf..c968cc0 100644 --- a/.config/nvim/lua/colorscheme.lua +++ b/.config/nvim/lua/colorscheme.lua @@ -1,16 +1,15 @@ --- Set the colorscheme and any related options. +-- I use dark terminals and schemes, so use a dark background. vim.opt.background = 'dark' -- Settings for gruvbox-material --- vim.g.gruvbox_material_palette = 'mix' --- vim.g.gruvbox_material_background = 'hard' --- vim.g.gruvbox_material_enable_bold = 1 --- vim.cmd 'colorscheme gruvbox-material' +vim.g.gruvbox_material_palette = 'mix' +vim.g.gruvbox_material_background = 'hard' +vim.g.gruvbox_material_enable_bold = 1 -- Settings for material vim.g.material_style = "palenight" -require('material').setup({ +require('material').setup { italics = { comments = true, -- Enable italic comments @@ -24,6 +23,7 @@ require('material').setup({ nvim_navic = false, hop = false, } -}) +} +-- Set the color scheme vim.cmd 'colorscheme material' diff --git a/.config/nvim/lua/general.lua b/.config/nvim/lua/general.lua index bb016aa..fb5dd25 100644 --- a/.config/nvim/lua/general.lua +++ b/.config/nvim/lua/general.lua @@ -60,6 +60,16 @@ opt.expandtab = true opt.smarttab = true opt.autoindent = true +-- I don't use indentation when writing HTML, and autoindentation makes any form +-- of editing flat out painful. +vim.api.nvim_create_autocmd("FileType", { + pattern = 'html', + callback = function() + vim.opt_local.autoindent = false + vim.opt_local.indentexpr = '' + end, +}) + ----------------------------------------------------------- -- Memory, CPU ----------------------------------------------------------- @@ -87,27 +97,6 @@ opt.hlsearch = true ----------------------------------------------------------- -- Startup ----------------------------------------------------------- + -- Disable nvim intro opt.shortmess:append "sI" - --- Disable builtins plugins -local disabled_built_ins = { - "gzip", - "zip", - "zipPlugin", - "tar", - "tarPlugin", - "getscript", - "getscriptPlugin", - "vimball", - "vimballPlugin", - "2html_plugin", - "logipat", - "rrhelper", - "spellfile_plugin", - "matchit" -} - -for _, plugin in pairs(disabled_built_ins) do - g["loaded_" .. plugin] = 1 -end diff --git a/.config/nvim/lua/keymap.lua b/.config/nvim/lua/keymap.lua index b41fada..9f391fa 100644 --- a/.config/nvim/lua/keymap.lua +++ b/.config/nvim/lua/keymap.lua @@ -61,6 +61,9 @@ map('n', 'fg', 'Telescope live_grep') -- Metals commands map('n', 'fm', 'Telescope metals commands') +-- Search project TODOs in Telescope +map('n', 'ft', 'TodoTelescope') + ----------------------------------------------------------- -- Trouble ----------------------------------------------------------- @@ -83,6 +86,9 @@ map('n', 'xl', 'TroubleToggle loclist') -- Show LSP references map('n', 'xr', 'TroubleToggle lsp_references') +-- Show project TODOs in Trouble +map('n', 'xt', 'TodoTrouble') + ----------------------------------------------------------- -- Floaterm ----------------------------------------------------------- diff --git a/.config/nvim/lua/packer_init.lua b/.config/nvim/lua/packer_init.lua index 833bfd5..a713625 100644 --- a/.config/nvim/lua/packer_init.lua +++ b/.config/nvim/lua/packer_init.lua @@ -71,7 +71,7 @@ return require('packer').startup(function(use) use { 'hrsh7th/nvim-cmp', requires = { - 'hrsh7th/cmp-nvim-lsp', -- add once LSP is supported + 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-path', 'hrsh7th/cmp-buffer' } @@ -130,9 +130,6 @@ return require('packer').startup(function(use) -- Improve startup time by replacing default filetype autocmds use 'nathom/filetype.nvim' - -- Improve the core vim.ui - use 'stevearc/dressing.nvim' - -- Special highlighting and tracking for certain notable words use { 'folke/todo-comments.nvim', diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua index 8bdf6a3..345500d 100644 --- a/.config/nvim/lua/plugins/cmp.lua +++ b/.config/nvim/lua/plugins/cmp.lua @@ -4,7 +4,7 @@ cmp.setup{ sources = { { name = 'nvim_lsp' }, { name = 'path' }, - { name = 'buffer', option = { keyword_length = 3 }, }, + { name = 'buffer', option = { keyword_length = 4 }, }, }, mapping = { [''] = cmp.mapping.confirm({}), diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 4a0f84f..d481771 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -6,10 +6,10 @@ local on_attach = function(client, bufnr) buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') end --- Advertise the nvim-cmp capabilities to LSP servers +-- Establish a set of capabilities so we can advertise nvim-cmp support. local capabilities = vim.lsp.protocol.make_client_capabilities() --- nvim-cmp support. +-- Add nvim-cmp support to the capabilities. capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities) -- zls = zig language server diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua index 550af10..e09b28f 100644 --- a/.config/nvim/lua/plugins/lualine.lua +++ b/.config/nvim/lua/plugins/lualine.lua @@ -1,4 +1,3 @@ --- Awaiting metals setup local function metals_status_for_lualine() return vim.g["metals_status"] or "" end diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua index d5464ea..33cf7d4 100644 --- a/.config/nvim/lua/plugins/treesitter.lua +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -1,7 +1,7 @@ require'nvim-treesitter.configs'.setup { -- One of "all", "maintained", or a list of languages ensure_installed = { - "c", "zig", "bash", "scala", "yaml", "html", "css", "javascript", + "c", "zig", "bash", "scala", "yaml", "css", "javascript", "latex", "clojure", "lua", "cpp" },