diff --git a/README.md b/README.md index 6a6c6c8b..6b446653 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # Personal dotfiles + Collection of various settings, configurations and other miscellaneous tools. ## Settings + - [neovim](https://neovim.io) - [kitty](https://sw.kovidgoyal.net/kitty/) - [lazygit](https://github.com/jesseduffield/lazygit) @@ -11,9 +13,11 @@ Collection of various settings, configurations and other miscellaneous tools. - [zsh]() paths and aliases ## Fonts + - [NerdFonts symbols](https://github.com/ryanoasis/nerd-fonts) ## Binaries + - [EFM LSP]() - [Lazygit]() - [Lua LSP]() @@ -22,11 +26,13 @@ Collection of various settings, configurations and other miscellaneous tools. - [Treesitter]() ## Templates + - SSH config - Python package - Crontab ## Installation + Run `make` to symlink configs and download extras. `software.sh` (WIP) installs common programs. diff --git a/config/nvim/README.md b/config/nvim/README.md index 6d2ac341..4b012e82 100644 --- a/config/nvim/README.md +++ b/config/nvim/README.md @@ -1,7 +1,9 @@ # Vim config + Personal configuration and plugins for Vim ## Installing neovim AppImage + ```bash curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage chmod u+x nvim.appimage @@ -9,23 +11,29 @@ mv nvim.appimage "$HOME/bin/nvim" ``` ## Installing configuration + ```bash ln -s /path/to/config/nvim ${XDG_CONFIG_HOME:-$HOME/.config}/nvim ``` ### Install script + `install.sh` currently handles installing `Packer` and `pynvim`. Will also update existing installs if already present. ### Installing `Packer` plugin manager + ```bash git clone --depth 1 https://github.com/wbthomason/packer.nvim\ $HOME/.local/share/nvim/site/pack/packer/start/packer.nvim ``` + Plugin definitions are in `plugins.lua`, inside `vim` run `:PackerSync` to install plugins ## Enabling python support + Set up neovim specific virtual environment to install `pynvim` package: + ```bash python3 -m venv "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/venv" source "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/venv/bin/activate" @@ -34,6 +42,7 @@ source deactivate ``` ### Installing language servers using `pipx` + Install [pipx](https://pypa.github.io/pipx/) in chosen manner, e.g. as given in documentation: ```bash @@ -52,4 +61,5 @@ pipx install zimports ``` ## Add LUA language server + Follow instructions from [sumneko/lua-language-server GitHub](https://github.com/sumneko/lua-language-server/wiki/Getting-Started#command-line). diff --git a/config/nvim/init.lua b/config/nvim/init.lua index 2ba022a2..ba412d37 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -1,11 +1,11 @@ -- Set vim options -require 'options' +require("options") -- Load plugins as defined for Packer -require 'plugins' +require("plugins") -- Define custom keymappings -require 'keymaps' +require("keymaps") -- Remaining vim commands to be converted to lua -require 'vimcommands' +require("vimcommands") diff --git a/config/nvim/lua/config/cmp.lua b/config/nvim/lua/config/cmp.lua index 0f03f9f2..adcde1b6 100644 --- a/config/nvim/lua/config/cmp.lua +++ b/config/nvim/lua/config/cmp.lua @@ -1,75 +1,75 @@ -local cmp = require 'cmp' -local luasnip = require 'luasnip' +local cmp = require("cmp") +local luasnip = require("luasnip") -require('luasnip.loaders.from_vscode').lazy_load() +require("luasnip.loaders.from_vscode").lazy_load() cmp.setup({ - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) -- For `luasnip` users. - end, - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), -- Up - [''] = cmp.mapping.scroll_docs(4), -- Down - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }, - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end, { 'i', 's' }), - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { 'i', 's' }), - }), - sources = { - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - { name = 'latex_symbols' }, - } + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) -- For `luasnip` users. + end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), -- Up + [""] = cmp.mapping.scroll_docs(4), -- Down + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }), + sources = { + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "latex_symbols" }, + }, }) -- Set configuration for specific filetype. -cmp.setup.filetype('gitcommit', { - sources = { - { name = 'git' }, - { name = 'commit' }, - { name = 'buffer' }, - } +cmp.setup.filetype("gitcommit", { + sources = { + { name = "git" }, + { name = "commit" }, + { name = "buffer" }, + }, }) -cmp.setup.filetype('markdown', { - sources = { - { name = 'spell' }, - { name = 'buffer' }, - }, +cmp.setup.filetype("markdown", { + sources = { + { name = "spell" }, + { name = "buffer" }, + }, }) -cmp.setup.cmdline('/', { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = 'buffer' } - } +cmp.setup.cmdline("/", { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = "buffer" }, + }, }) -cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = 'path' }, - { name = 'cmdline' } - } +cmp.setup.cmdline(":", { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = "path" }, + { name = "cmdline" }, + }, }) diff --git a/config/nvim/lua/config/feline.lua b/config/nvim/lua/config/feline.lua index 76c04738..571562df 100644 --- a/config/nvim/lua/config/feline.lua +++ b/config/nvim/lua/config/feline.lua @@ -31,50 +31,50 @@ local fmt = string.format ---@param n number ---@return string local hex = function(n) - if n then - return fmt("#%06x", n) - end + if n then + return fmt("#%06x", n) + end end ---Parse `style` string into nvim_set_hl options ---@param style string ---@return table local function parse_style(style) - if not style or style == "NONE" then - return {} - end + if not style or style == "NONE" then + return {} + end - local result = {} - for token in string.gmatch(style, "([^,]+)") do - result[token] = true - end + local result = {} + for token in string.gmatch(style, "([^,]+)") do + result[token] = true + end - return result + return result end ---Get highlight opts for a given highlight group name ---@param name string ---@return table local function get_highlight(name) - local hl = vim.api.nvim_get_hl_by_name(name, true) - if hl.link then - return get_highlight(hl.link) - end + local hl = vim.api.nvim_get_hl_by_name(name, true) + if hl.link then + return get_highlight(hl.link) + end - local result = parse_style(hl.style) - result.fg = hl.foreground and hex(hl.foreground) - result.bg = hl.background and hex(hl.background) - result.sp = hl.special and hex(hl.special) + local result = parse_style(hl.style) + result.fg = hl.foreground and hex(hl.foreground) + result.bg = hl.background and hex(hl.background) + result.sp = hl.special and hex(hl.special) - return result + return result end ---Set highlight group from provided table ---@param groups table local function set_highlights(groups) - for group, opts in pairs(groups) do - vim.api.nvim_set_hl(0, group, opts) - end + for group, opts in pairs(groups) do + vim.api.nvim_set_hl(0, group, opts) + end end ---Generate a color palette from the current applied colorscheme @@ -92,27 +92,27 @@ local function generate_pallet_from_colorscheme() white = { index = 7, default = "#dfdfe0" }, } - local diagnostic_map = { - hint = { hl = "DiagnosticHint", default = color_map.green.default }, - info = { hl = "DiagnosticInfo", default = color_map.blue.default }, - warn = { hl = "DiagnosticWarn", default = color_map.yellow.default }, - error = { hl = "DiagnosticError", default = color_map.red.default }, - } + local diagnostic_map = { + hint = { hl = "DiagnosticHint", default = color_map.green.default }, + info = { hl = "DiagnosticInfo", default = color_map.blue.default }, + warn = { hl = "DiagnosticWarn", default = color_map.yellow.default }, + error = { hl = "DiagnosticError", default = color_map.red.default }, + } - local pallet = {} - for name, value in pairs(color_map) do - local global_name = "terminal_color_" .. value.index - pallet[name] = vim.g[global_name] and vim.g[global_name] or value.default - end + local pallet = {} + for name, value in pairs(color_map) do + local global_name = "terminal_color_" .. value.index + pallet[name] = vim.g[global_name] and vim.g[global_name] or value.default + end - for name, value in pairs(diagnostic_map) do - pallet[name] = get_highlight(value.hl).fg or value.default - end + for name, value in pairs(diagnostic_map) do + pallet[name] = get_highlight(value.hl).fg or value.default + end - pallet.sl = get_highlight("StatusLine") - pallet.sel = get_highlight("TabLineSel") + pallet.sl = get_highlight("StatusLine") + pallet.sel = get_highlight("TabLineSel") - return pallet + return pallet end ---Generate user highlight groups based on the curent applied colorscheme @@ -120,7 +120,7 @@ end ---NOTE: This is a global because I dont known where this file will be in your config ---and it is needed for the autocmd below _G._generate_user_statusline_highlights = function() - local pal = generate_pallet_from_colorscheme() + local pal = generate_pallet_from_colorscheme() -- stylua: ignore local sl_colors = { @@ -134,332 +134,333 @@ _G._generate_user_statusline_highlights = function() White = { fg = pal.white, bg = pal.black }, } - local colors = {} - for name, value in pairs(sl_colors) do - colors["User" .. name] = { fg = value.fg, bg = value.bg, bold = true } - colors["UserRv" .. name] = { fg = value.bg, bg = value.fg, bold = true } - end + local colors = {} + for name, value in pairs(sl_colors) do + colors["User" .. name] = { fg = value.fg, bg = value.bg, bold = true } + colors["UserRv" .. name] = { fg = value.bg, bg = value.fg, bold = true } + end - local status = vim.o.background == "dark" and { fg = pal.black, bg = pal.white } or { fg = pal.white, bg = pal.black } + local status = vim.o.background == "dark" and { fg = pal.black, bg = pal.white } + or { fg = pal.white, bg = pal.black } - local groups = { - -- statusline - UserSLHint = { fg = pal.sl.bg, bg = pal.hint, bold = true }, - UserSLInfo = { fg = pal.sl.bg, bg = pal.info, bold = true }, - UserSLWarn = { fg = pal.sl.bg, bg = pal.warn, bold = true }, - UserSLError = { fg = pal.sl.bg, bg = pal.error, bold = true }, - UserSLStatus = { fg = status.fg, bg = status.bg, bold = true }, + local groups = { + -- statusline + UserSLHint = { fg = pal.sl.bg, bg = pal.hint, bold = true }, + UserSLInfo = { fg = pal.sl.bg, bg = pal.info, bold = true }, + UserSLWarn = { fg = pal.sl.bg, bg = pal.warn, bold = true }, + UserSLError = { fg = pal.sl.bg, bg = pal.error, bold = true }, + UserSLStatus = { fg = status.fg, bg = status.bg, bold = true }, - UserSLFtHint = { fg = pal.sel.bg, bg = pal.hint }, - UserSLHintInfo = { fg = pal.hint, bg = pal.info }, - UserSLInfoWarn = { fg = pal.info, bg = pal.warn }, - UserSLWarnError = { fg = pal.warn, bg = pal.error }, - UserSLErrorStatus = { fg = pal.error, bg = status.bg }, - UserSLStatusBg = { fg = status.bg, bg = pal.sl.bg }, + UserSLFtHint = { fg = pal.sel.bg, bg = pal.hint }, + UserSLHintInfo = { fg = pal.hint, bg = pal.info }, + UserSLInfoWarn = { fg = pal.info, bg = pal.warn }, + UserSLWarnError = { fg = pal.warn, bg = pal.error }, + UserSLErrorStatus = { fg = pal.error, bg = status.bg }, + UserSLStatusBg = { fg = status.bg, bg = pal.sl.bg }, - UserSLAlt = pal.sel, - UserSLAltSep = { fg = pal.sl.bg, bg = pal.sel.bg }, - UserSLGitBranch = { fg = pal.yellow, bg = pal.sl.bg }, - } + UserSLAlt = pal.sel, + UserSLAltSep = { fg = pal.sl.bg, bg = pal.sel.bg }, + UserSLGitBranch = { fg = pal.yellow, bg = pal.sl.bg }, + } - set_highlights(vim.tbl_extend("force", colors, groups)) + set_highlights(vim.tbl_extend("force", colors, groups)) end _generate_user_statusline_highlights() vim.api.nvim_create_augroup("UserStatuslineHighlightGroups", { clear = true }) vim.api.nvim_create_autocmd({ "SessionLoadPost", "ColorScheme" }, { - callback = function() - _generate_user_statusline_highlights() - end, + callback = function() + _generate_user_statusline_highlights() + end, }) ---------------------------------------------------------------------------------------------------- -- Feline local vi = { - -- Map vi mode to text name - text = { - n = "NORMAL", - no = "NORMAL", - i = "INSERT", - v = "VISUAL", - V = "V-LINE", - [""] = "V-BLOCK", - c = "COMMAND", - cv = "COMMAND", - ce = "COMMAND", - R = "REPLACE", - Rv = "REPLACE", - s = "SELECT", - S = "SELECT", - [""] = "SELECT", - t = "TERMINAL", - }, + -- Map vi mode to text name + text = { + n = "NORMAL", + no = "NORMAL", + i = "INSERT", + v = "VISUAL", + V = "V-LINE", + [""] = "V-BLOCK", + c = "COMMAND", + cv = "COMMAND", + ce = "COMMAND", + R = "REPLACE", + Rv = "REPLACE", + s = "SELECT", + S = "SELECT", + [""] = "SELECT", + t = "TERMINAL", + }, - -- Maps vi mode to highlight group color defined above - colors = { - n = "UserRvCyan", - no = "UserRvCyan", - i = "UserSLStatus", - v = "UserRvMagenta", - V = "UserRvMagenta", - [""] = "UserRvMagenta", - R = "UserRvRed", - Rv = "UserRvRed", - r = "UserRvBlue", - rm = "UserRvBlue", - s = "UserRvMagenta", - S = "UserRvMagenta", - [""] = "FelnMagenta", - c = "UserRvYellow", - ["!"] = "UserRvBlue", - t = "UserRvBlue", - }, + -- Maps vi mode to highlight group color defined above + colors = { + n = "UserRvCyan", + no = "UserRvCyan", + i = "UserSLStatus", + v = "UserRvMagenta", + V = "UserRvMagenta", + [""] = "UserRvMagenta", + R = "UserRvRed", + Rv = "UserRvRed", + r = "UserRvBlue", + rm = "UserRvBlue", + s = "UserRvMagenta", + S = "UserRvMagenta", + [""] = "FelnMagenta", + c = "UserRvYellow", + ["!"] = "UserRvBlue", + t = "UserRvBlue", + }, - -- Maps vi mode to seperator highlight goup defined above - sep = { - n = "UserCyan", - no = "UserCyan", - i = "UserSLStatusBg", - v = "UserMagenta", - V = "UserMagenta", - [""] = "UserMagenta", - R = "UserRed", - Rv = "UserRed", - r = "UserBlue", - rm = "UserBlue", - s = "UserMagenta", - S = "UserMagenta", - [""] = "FelnMagenta", - c = "UserYellow", - ["!"] = "UserBlue", - t = "UserBlue", - }, + -- Maps vi mode to seperator highlight goup defined above + sep = { + n = "UserCyan", + no = "UserCyan", + i = "UserSLStatusBg", + v = "UserMagenta", + V = "UserMagenta", + [""] = "UserMagenta", + R = "UserRed", + Rv = "UserRed", + r = "UserBlue", + rm = "UserBlue", + s = "UserMagenta", + S = "UserMagenta", + [""] = "FelnMagenta", + c = "UserYellow", + ["!"] = "UserBlue", + t = "UserBlue", + }, } local icons = { - locker = "", -- #f023 - page = "☰", -- 2630 - line_number = "", -- e0a1 - connected = "", -- f817 - dos = "", -- e70f - unix = "", -- f17c - mac = "", -- f179 - mathematical_L = "𝑳", - vertical_bar = "┃", - vertical_bar_thin = "│", - left = "", - right = "", - block = "█", - left_filled = "", - right_filled = "", - slant_left = "", - slant_left_thin = "", - slant_right = "", - slant_right_thin = "", - slant_left_2 = "", - slant_left_2_thin = "", - slant_right_2 = "", - slant_right_2_thin = "", - left_rounded = "", - left_rounded_thin = "", - right_rounded = "", - right_rounded_thin = "", - circle = "●", + locker = "", -- #f023 + page = "☰", -- 2630 + line_number = "", -- e0a1 + connected = "", -- f817 + dos = "", -- e70f + unix = "", -- f17c + mac = "", -- f179 + mathematical_L = "𝑳", + vertical_bar = "┃", + vertical_bar_thin = "│", + left = "", + right = "", + block = "█", + left_filled = "", + right_filled = "", + slant_left = "", + slant_left_thin = "", + slant_right = "", + slant_right_thin = "", + slant_left_2 = "", + slant_left_2_thin = "", + slant_right_2 = "", + slant_right_2_thin = "", + left_rounded = "", + left_rounded_thin = "", + right_rounded = "", + right_rounded_thin = "", + circle = "●", } ---Get the number of diagnostic messages for the provided severity ---@param str string [ERROR | WARN | INFO | HINT] ---@return string local function get_diag(str) - local diagnostics = vim.diagnostic.get(0, { severity = vim.diagnostic.severity[str] }) - local count = #diagnostics + local diagnostics = vim.diagnostic.get(0, { severity = vim.diagnostic.severity[str] }) + local count = #diagnostics - return (count > 0) and " " .. count .. " " or "" + return (count > 0) and " " .. count .. " " or "" end ---Get highlight group from vi mode ---@return string local function vi_mode_hl() - return vi.colors[vim.fn.mode()] or "UserSLViBlack" + return vi.colors[vim.fn.mode()] or "UserSLViBlack" end ---Get sep highlight group from vi mode local function vi_sep_hl() - return vi.sep[vim.fn.mode()] or "UserSLBlack" + return vi.sep[vim.fn.mode()] or "UserSLBlack" end ---Get the path of the file relative to the cwd ---@return string local function file_info() - local list = {} - if vim.bo.readonly then - table.insert(list, "🔒") - end + local list = {} + if vim.bo.readonly then + table.insert(list, "🔒") + end - if vim.bo.modified then - table.insert(list, "●") - end + if vim.bo.modified then + table.insert(list, "●") + end - table.insert(list, vim.fn.fnamemodify(vim.api.nvim_buf_get_name(0), ":~:.")) + table.insert(list, vim.fn.fnamemodify(vim.api.nvim_buf_get_name(0), ":~:.")) - return table.concat(list, " ") + return table.concat(list, " ") end -- Create a table that contians every status line commonent local c = { - vimode = { - provider = function() - return fmt(" %s ", vi.text[vim.fn.mode()]) - end, - hl = vi_mode_hl, - right_sep = { str = " ", hl = vi_sep_hl }, - }, - gitbranch = { - provider = "git_branch", - icon = " ", - hl = "UserSLGitBranch", - right_sep = { str = " ", hl = "UserSLGitBranch" }, - enabled = function() - return vim.b.gitsigns_status_dict ~= nil - end, - }, - file_type = { - provider = function() - return fmt(" %s ", vim.bo.filetype:upper()) - end, - hl = "UserSLAlt", - }, - fileinfo = { - provider = { name = "file_info", opts = { type = "relative" } }, - hl = "UserSLAlt", - left_sep = { str = " ", hl = "UserSLAltSep" }, - right_sep = { str = " ", hl = "UserSLAltSep" }, - }, - file_enc = { - provider = function() - local os = icons[vim.bo.fileformat] or "" - return fmt(" %s %s ", os, vim.bo.fileencoding) - end, - hl = "StatusLine", - left_sep = { str = icons.left_filled, hl = "UserSLAltSep" }, - }, - cur_position = { - provider = function() - -- TODO: What about 4+ diget line numbers? - return fmt(" %3d:%-2d ", unpack(vim.api.nvim_win_get_cursor(0))) - end, - hl = vi_mode_hl, - left_sep = { str = icons.left_filled, hl = vi_sep_hl }, - }, - cur_percent = { - provider = function() - return " " .. require("feline.providers.cursor").line_percentage() .. " " - end, - hl = vi_mode_hl, - left_sep = { str = icons.left, hl = vi_mode_hl }, - }, - default = { -- needed to pass the parent StatusLine hl group to right hand side - provider = "", - hl = "StatusLine", - }, - lsp_status = { - provider = function() - return require("lsp-status").status() - end, - hl = "UserSLStatus", - left_sep = { str = "", hl = "UserSLStatusBg", always_visible = true }, - right_sep = { str = "", hl = "UserSLErrorStatus", always_visible = true }, - }, - lsp_error = { - provider = function() - return get_diag("ERROR") - end, - hl = "UserSLError", - right_sep = { str = "", hl = "UserSLWarnError", always_visible = true }, - }, - lsp_warn = { - provider = function() - return get_diag("WARN") - end, - hl = "UserSLWarn", - right_sep = { str = "", hl = "UserSLInfoWarn", always_visible = true }, - }, - lsp_info = { - provider = function() - return get_diag("INFO") - end, - hl = "UserSLInfo", - right_sep = { str = "", hl = "UserSLHintInfo", always_visible = true }, - }, - lsp_hint = { - provider = function() - return get_diag("HINT") - end, - hl = "UserSLHint", - right_sep = { str = "", hl = "UserSLFtHint", always_visible = true }, - }, + vimode = { + provider = function() + return fmt(" %s ", vi.text[vim.fn.mode()]) + end, + hl = vi_mode_hl, + right_sep = { str = " ", hl = vi_sep_hl }, + }, + gitbranch = { + provider = "git_branch", + icon = " ", + hl = "UserSLGitBranch", + right_sep = { str = " ", hl = "UserSLGitBranch" }, + enabled = function() + return vim.b.gitsigns_status_dict ~= nil + end, + }, + file_type = { + provider = function() + return fmt(" %s ", vim.bo.filetype:upper()) + end, + hl = "UserSLAlt", + }, + fileinfo = { + provider = { name = "file_info", opts = { type = "relative" } }, + hl = "UserSLAlt", + left_sep = { str = " ", hl = "UserSLAltSep" }, + right_sep = { str = " ", hl = "UserSLAltSep" }, + }, + file_enc = { + provider = function() + local os = icons[vim.bo.fileformat] or "" + return fmt(" %s %s ", os, vim.bo.fileencoding) + end, + hl = "StatusLine", + left_sep = { str = icons.left_filled, hl = "UserSLAltSep" }, + }, + cur_position = { + provider = function() + -- TODO: What about 4+ diget line numbers? + return fmt(" %3d:%-2d ", unpack(vim.api.nvim_win_get_cursor(0))) + end, + hl = vi_mode_hl, + left_sep = { str = icons.left_filled, hl = vi_sep_hl }, + }, + cur_percent = { + provider = function() + return " " .. require("feline.providers.cursor").line_percentage() .. " " + end, + hl = vi_mode_hl, + left_sep = { str = icons.left, hl = vi_mode_hl }, + }, + default = { -- needed to pass the parent StatusLine hl group to right hand side + provider = "", + hl = "StatusLine", + }, + lsp_status = { + provider = function() + return require("lsp-status").status() + end, + hl = "UserSLStatus", + left_sep = { str = "", hl = "UserSLStatusBg", always_visible = true }, + right_sep = { str = "", hl = "UserSLErrorStatus", always_visible = true }, + }, + lsp_error = { + provider = function() + return get_diag("ERROR") + end, + hl = "UserSLError", + right_sep = { str = "", hl = "UserSLWarnError", always_visible = true }, + }, + lsp_warn = { + provider = function() + return get_diag("WARN") + end, + hl = "UserSLWarn", + right_sep = { str = "", hl = "UserSLInfoWarn", always_visible = true }, + }, + lsp_info = { + provider = function() + return get_diag("INFO") + end, + hl = "UserSLInfo", + right_sep = { str = "", hl = "UserSLHintInfo", always_visible = true }, + }, + lsp_hint = { + provider = function() + return get_diag("HINT") + end, + hl = "UserSLHint", + right_sep = { str = "", hl = "UserSLFtHint", always_visible = true }, + }, - in_fileinfo = { - provider = "file_info", - hl = "StatusLine", - }, - in_position = { - provider = "position", - hl = "StatusLine", - }, + in_fileinfo = { + provider = "file_info", + hl = "StatusLine", + }, + in_position = { + provider = "position", + hl = "StatusLine", + }, } local active = { - { -- left - c.vimode, - c.gitbranch, - c.fileinfo, - c.default, -- must be last - }, - { -- right - c.lsp_status, - c.lsp_error, - c.lsp_warn, - c.lsp_info, - c.lsp_hint, - c.file_type, - c.file_enc, - c.cur_position, - c.cur_percent, - }, + { -- left + c.vimode, + c.gitbranch, + c.fileinfo, + c.default, -- must be last + }, + { -- right + c.lsp_status, + c.lsp_error, + c.lsp_warn, + c.lsp_info, + c.lsp_hint, + c.file_type, + c.file_enc, + c.cur_position, + c.cur_percent, + }, } local inactive = { - { c.in_fileinfo }, -- left - { c.in_position }, -- right + { c.in_fileinfo }, -- left + { c.in_position }, -- right } require("feline").setup({ - components = { active = active, inactive = inactive }, - highlight_reset_triggers = {}, - force_inactive = { - filetypes = { - "NvimTree", - "Trouble", - "packer", - "dap-repl", - "dapui_scopes", - "dapui_stacks", - "dapui_watches", - "dapui_repl", - "LspTrouble", - "qf", - "help", - }, - buftypes = { "terminal" }, - bufnames = {}, - }, - disable = { - filetypes = { - "dashboard", - "startify", - }, - }, + components = { active = active, inactive = inactive }, + highlight_reset_triggers = {}, + force_inactive = { + filetypes = { + "NvimTree", + "Trouble", + "packer", + "dap-repl", + "dapui_scopes", + "dapui_stacks", + "dapui_watches", + "dapui_repl", + "LspTrouble", + "qf", + "help", + }, + buftypes = { "terminal" }, + bufnames = {}, + }, + disable = { + filetypes = { + "dashboard", + "startify", + }, + }, }) diff --git a/config/nvim/lua/config/gitsigns.lua b/config/nvim/lua/config/gitsigns.lua index 5e49d3a4..734933ae 100644 --- a/config/nvim/lua/config/gitsigns.lua +++ b/config/nvim/lua/config/gitsigns.lua @@ -1,45 +1,57 @@ -require('gitsigns').setup { - signcolumn = true, - numhl = true, - linehl = false, - current_line_blame = true, - word_diff = false, - on_attach = function(bufnr) - local gs = package.loaded.gitsigns +require("gitsigns").setup({ + signcolumn = true, + numhl = true, + linehl = false, + current_line_blame = true, + word_diff = false, + on_attach = function(bufnr) + local gs = package.loaded.gitsigns - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end - -- Navigation - map('n', ']c', function() - if vim.wo.diff then return ']c' end - vim.schedule(function() gs.next_hunk() end) - return '' - end, { expr = true }) + -- Navigation + map("n", "]c", function() + if vim.wo.diff then + return "]c" + end + vim.schedule(function() + gs.next_hunk() + end) + return "" + end, { expr = true }) - map('n', '[c', function() - if vim.wo.diff then return '[c' end - vim.schedule(function() gs.prev_hunk() end) - return '' - end, { expr = true }) + map("n", "[c", function() + if vim.wo.diff then + return "[c" + end + vim.schedule(function() + gs.prev_hunk() + end) + return "" + end, { expr = true }) - -- Actions - map({ 'n', 'v' }, 'hs', ':Gitsigns stage_hunk') - map({ 'n', 'v' }, 'hr', ':Gitsigns reset_hunk') - map('n', 'hS', gs.stage_buffer) - map('n', 'hu', gs.undo_stage_hunk) - map('n', 'hR', gs.reset_buffer) - map('n', 'hp', gs.preview_hunk) - map('n', 'hb', function() gs.blame_line { full = true } end) - map('n', 'tb', gs.toggle_current_line_blame) - map('n', 'hd', gs.diffthis) - map('n', 'hD', function() gs.diffthis('~') end) - map('n', 'td', gs.toggle_deleted) + -- Actions + map({ "n", "v" }, "hs", ":Gitsigns stage_hunk") + map({ "n", "v" }, "hr", ":Gitsigns reset_hunk") + map("n", "hS", gs.stage_buffer) + map("n", "hu", gs.undo_stage_hunk) + map("n", "hR", gs.reset_buffer) + map("n", "hp", gs.preview_hunk) + map("n", "hb", function() + gs.blame_line({ full = true }) + end) + map("n", "tb", gs.toggle_current_line_blame) + map("n", "hd", gs.diffthis) + map("n", "hD", function() + gs.diffthis("~") + end) + map("n", "td", gs.toggle_deleted) - -- Text object - map({ 'o', 'x' }, 'ih', ':Gitsigns select_hunk') - end, -} + -- Text object + map({ "o", "x" }, "ih", ":Gitsigns select_hunk") + end, +}) diff --git a/config/nvim/lua/config/lsp.lua b/config/nvim/lua/config/lsp.lua index b68e05a4..0dfc19df 100644 --- a/config/nvim/lua/config/lsp.lua +++ b/config/nvim/lua/config/lsp.lua @@ -1,119 +1,124 @@ -local lsp_status = require('lsp-status') -lsp_status.config { - diagnostics = false, -} +local lsp_status = require("lsp-status") +lsp_status.config({ + diagnostics = false, +}) lsp_status.register_progress() --- Set up null_ls first -local null_ls = require("null-ls") -null_ls.setup { - sources = { - null_ls.builtins.code_actions.gitsigns, - null_ls.builtins.diagnostics.mypy, - null_ls.builtins.diagnostics.zsh, - null_ls.builtins.formatting.black, - null_ls.builtins.formatting.isort, - null_ls.builtins.formatting.latexindent, - null_ls.builtins.formatting.trim_whitespace, - null_ls.builtins.hover.dictionary, - }, -} - -- Mappings. -- See `:help vim.diagnostic.*` for documentation on any of the below functions local opts = { noremap = true, silent = true } -vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) -vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) -vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) +vim.keymap.set("n", "e", vim.diagnostic.open_float, opts) +vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) +vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts) +vim.keymap.set("n", "q", vim.diagnostic.setloclist, opts) local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) end -local lsp_formatting = function (bufnr) - vim.lsp.buf.format({ - filter = function (client) - return client.name == "null-ls" - end, - bufnr = bufnr, - timeout_ms = 2000, - -- async = true, - }) +local lsp_formatting = function(bufnr) + vim.lsp.buf.format({ + filter = function(client) + return client.name == "null-ls" + end, + bufnr = bufnr, + timeout_ms = 2000, + -- async = true, + }) end -- Use an on_attach function to only map the following keys -- after the language server attaches to the current buffer local on_attach = function(client, bufnr) - lsp_status.on_attach(client) - -- Mappings. - -- See `:help vim.lsp.*` for documentation on any of the below functions - local bufopts = { noremap = true, silent = true, buffer = bufnr } - vim.keymap.set('n', 'gD', vim.lsp.buf.definition, bufopts) - vim.keymap.set('n', 'gd', 'Trouble lsp_definitions', bufopts) - vim.keymap.set('n', 'gR', vim.lsp.buf.references, bufopts) - vim.keymap.set('n', 'gr', 'Trouble lsp_references', bufopts) - vim.keymap.set('n', 'gI', vim.lsp.buf.implementation, bufopts) - vim.keymap.set('n', 'gi', 'Trouble lsp_implementations', bufopts) - vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) - vim.keymap.set('n', '', vim.lsp.buf.signature_help, bufopts) - vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, bufopts) - vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, bufopts) - vim.keymap.set('n', 'wl', function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, bufopts) - vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, bufopts) - vim.keymap.set('n', 'rn', vim.lsp.buf.rename, bufopts) - vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, bufopts) - vim.keymap.set('n', 'i', lsp_formatting, bufopts) + lsp_status.on_attach(client) + -- Mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + local bufopts = { noremap = true, silent = true, buffer = bufnr } + vim.keymap.set("n", "gD", vim.lsp.buf.definition, bufopts) + vim.keymap.set("n", "gd", "Trouble lsp_definitions", bufopts) + vim.keymap.set("n", "gR", vim.lsp.buf.references, bufopts) + vim.keymap.set("n", "gr", "Trouble lsp_references", bufopts) + vim.keymap.set("n", "gI", vim.lsp.buf.implementation, bufopts) + vim.keymap.set("n", "gi", "Trouble lsp_implementations", bufopts) + vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts) + vim.keymap.set("n", "", vim.lsp.buf.signature_help, bufopts) + vim.keymap.set("n", "wa", vim.lsp.buf.add_workspace_folder, bufopts) + vim.keymap.set("n", "wr", vim.lsp.buf.remove_workspace_folder, bufopts) + vim.keymap.set("n", "wl", function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, bufopts) + vim.keymap.set("n", "D", vim.lsp.buf.type_definition, bufopts) + vim.keymap.set("n", "rn", vim.lsp.buf.rename, bufopts) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, bufopts) + vim.keymap.set("n", "i", lsp_formatting, bufopts) end local lsp_flags = { - -- This is the default in Nvim 0.7+ - debounce_text_changes = 150, + -- This is the default in Nvim 0.7+ + debounce_text_changes = 150, } -local capabilities = vim.tbl_extend('keep', require('cmp_nvim_lsp').default_capabilities(), lsp_status.capabilities) +local capabilities = vim.tbl_extend("keep", require("cmp_nvim_lsp").default_capabilities(), lsp_status.capabilities) -require('lspconfig')['pyright'].setup{ - on_attach = on_attach, - flags = lsp_flags, - capabilities = capabilities, -} +-- Set up null_ls first +local null_ls = require("null-ls") +null_ls.setup({ + sources = { + null_ls.builtins.code_actions.gitsigns, + null_ls.builtins.diagnostics.mypy, + null_ls.builtins.diagnostics.zsh, + null_ls.builtins.formatting.black, + null_ls.builtins.formatting.isort, + null_ls.builtins.formatting.trim_whitespace, + null_ls.builtins.formatting.stylua, + null_ls.builtins.formatting.shfmt, + null_ls.builtins.formatting.prettier, + null_ls.builtins.hover.dictionary, + }, + on_attach = on_attach, + flags = lsp_flags, + capabilities = capabilities, +}) -require('lspconfig')['fortls'].setup { - on_attach = on_attach, - flags = lsp_flags, - capabilities = capabilities -} +require("lspconfig")["pyright"].setup({ + on_attach = on_attach, + flags = lsp_flags, + capabilities = capabilities, +}) -require('lspconfig')['sumneko_lua'].setup { - settings = { - Lua = { - runtime = { - version = 'LuaJIT', - }, - diagnostics = { - globals = { 'vim' }, - }, - workspace = { - library = vim.api.nvim_get_runtime_file("", true), - checkThirdParty = false, - }, - telemetry = { - enable = false, - }, - }, - }, - on_attach = on_attach, - flags = lsp_flags, - capabilities = capabilities, -} +require("lspconfig")["fortls"].setup({ + on_attach = on_attach, + flags = lsp_flags, + capabilities = capabilities, +}) -require('lspconfig')['texlab'].setup { - on_attach = on_attach, - flags = lsp_flags, - capabilities = capabilities, -} +require("lspconfig")["sumneko_lua"].setup({ + settings = { + Lua = { + runtime = { + version = "LuaJIT", + }, + diagnostics = { + globals = { "vim" }, + }, + workspace = { + library = vim.api.nvim_get_runtime_file("", true), + checkThirdParty = false, + }, + telemetry = { + enable = false, + }, + }, + }, + on_attach = on_attach, + flags = lsp_flags, + capabilities = capabilities, +}) + +require("lspconfig")["texlab"].setup({ + on_attach = on_attach, + flags = lsp_flags, + capabilities = capabilities, +}) diff --git a/config/nvim/lua/config/nightfox.lua b/config/nvim/lua/config/nightfox.lua index e1af1941..8d5f1e57 100644 --- a/config/nvim/lua/config/nightfox.lua +++ b/config/nvim/lua/config/nightfox.lua @@ -1,7 +1,7 @@ -require('nightfox').setup { - options = { - transparent = true, - }, -} -require('nightfox').compile() +require("nightfox").setup({ + options = { + transparent = true, + }, +}) +require("nightfox").compile() vim.cmd("colorscheme nightfox") diff --git a/config/nvim/lua/config/nvim-tree.lua b/config/nvim/lua/config/nvim-tree.lua index f6f0bb24..4e9e710b 100644 --- a/config/nvim/lua/config/nvim-tree.lua +++ b/config/nvim/lua/config/nvim-tree.lua @@ -1,65 +1,65 @@ vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 vim.opt.termguicolors = true -require('nvim-tree').setup { - disable_netrw = true, - hijack_netrw = true, - hijack_cursor = true, - sync_root_with_cwd = true, - respect_buf_cwd = true, - update_focused_file = { - enable = true, - update_root = true, - }, - diagnostics = { - enable = true, - show_on_dirs = true, - show_on_open_dirs = false, - }, - git = { - enable = true, - show_on_dirs = true, - show_on_open_dirs = false, - }, - modified = { - enable = true, - show_on_dirs = true, - show_on_open_dirs = false, - }, - view = { - centralize_selection = true, - }, - renderer = { - add_trailing = true, - group_empty = true, - full_name = true, - highlight_git = true, - highlight_modified = "all", - indent_markers = { - enable = true, - }, - icons = { - show = { - git = false, - modified = false, - }, - }, - }, - filters = { - dotfiles = true, - }, -} +require("nvim-tree").setup({ + disable_netrw = true, + hijack_netrw = true, + hijack_cursor = true, + sync_root_with_cwd = true, + respect_buf_cwd = true, + update_focused_file = { + enable = true, + update_root = true, + }, + diagnostics = { + enable = true, + show_on_dirs = true, + show_on_open_dirs = false, + }, + git = { + enable = true, + show_on_dirs = true, + show_on_open_dirs = false, + }, + modified = { + enable = true, + show_on_dirs = true, + show_on_open_dirs = false, + }, + view = { + centralize_selection = true, + }, + renderer = { + add_trailing = true, + group_empty = true, + full_name = true, + highlight_git = true, + highlight_modified = "all", + indent_markers = { + enable = true, + }, + icons = { + show = { + git = false, + modified = false, + }, + }, + }, + filters = { + dotfiles = true, + }, +}) local function open_nvim_tree(data) - -- buffer is a [No Name] - local no_name = data.file == "" and vim.bo[data.buf].buftype == "" + -- buffer is a [No Name] + local no_name = data.file == "" and vim.bo[data.buf].buftype == "" - if not no_name then - return - end + if not no_name then + return + end - -- open the tree, find the file but don't focus it - require("nvim-tree.api").tree.toggle({ focus = false }) + -- open the tree, find the file but don't focus it + require("nvim-tree.api").tree.toggle({ focus = false }) end vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) diff --git a/config/nvim/lua/config/project.lua b/config/nvim/lua/config/project.lua index 94f9cde8..f08c1fd0 100644 --- a/config/nvim/lua/config/project.lua +++ b/config/nvim/lua/config/project.lua @@ -1,40 +1,40 @@ -require("project_nvim").setup { - -- Manual mode doesn't automatically change your root directory, so you have - -- the option to manually do so using `:ProjectRoot` command. - manual_mode = false, +require("project_nvim").setup({ + -- Manual mode doesn't automatically change your root directory, so you have + -- the option to manually do so using `:ProjectRoot` command. + manual_mode = false, - -- Methods of detecting the root directory. **"lsp"** uses the native neovim - -- lsp, while **"pattern"** uses vim-rooter like glob pattern matching. Here - -- order matters: if one is not detected, the other is used as fallback. You - -- can also delete or rearangne the detection methods. - detection_methods = { "pattern", "lsp" }, + -- Methods of detecting the root directory. **"lsp"** uses the native neovim + -- lsp, while **"pattern"** uses vim-rooter like glob pattern matching. Here + -- order matters: if one is not detected, the other is used as fallback. You + -- can also delete or rearangne the detection methods. + detection_methods = { "pattern", "lsp" }, - -- All the patterns used to detect root dir, when **"pattern"** is in - -- detection_methods - patterns = { ".git", ".venv", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" }, + -- All the patterns used to detect root dir, when **"pattern"** is in + -- detection_methods + patterns = { ".git", ".venv", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" }, - -- Table of lsp clients to ignore by name - -- eg: { "efm", ... } - ignore_lsp = {}, + -- Table of lsp clients to ignore by name + -- eg: { "efm", ... } + ignore_lsp = {}, - -- Don't calculate root dir on specific directories - -- Ex: { "~/.cargo/*", ... } - exclude_dirs = {}, + -- Don't calculate root dir on specific directories + -- Ex: { "~/.cargo/*", ... } + exclude_dirs = {}, - -- Show hidden files in telescope - show_hidden = false, + -- Show hidden files in telescope + show_hidden = false, - -- When set to false, you will get a message when project.nvim changes your - -- directory. - silent_chdir = true, + -- When set to false, you will get a message when project.nvim changes your + -- directory. + silent_chdir = true, - -- What scope to change the directory, valid options are - -- * global (default) - -- * tab - -- * win - scope_chdir = 'global', + -- What scope to change the directory, valid options are + -- * global (default) + -- * tab + -- * win + scope_chdir = "global", - -- Path where project.nvim will store the project history for use in - -- telescope - datapath = vim.fn.stdpath("data"), -} + -- Path where project.nvim will store the project history for use in + -- telescope + datapath = vim.fn.stdpath("data"), +}) diff --git a/config/nvim/lua/config/tabby.lua b/config/nvim/lua/config/tabby.lua index a7154058..bd89afd4 100644 --- a/config/nvim/lua/config/tabby.lua +++ b/config/nvim/lua/config/tabby.lua @@ -31,50 +31,50 @@ local fmt = string.format ---@param n number ---@return string local hex = function(n) - if n then - return fmt("#%06x", n) - end + if n then + return fmt("#%06x", n) + end end ---Parse `style` string into nvim_set_hl options ---@param style string ---@return table local function parse_style(style) - if not style or style == "NONE" then - return {} - end + if not style or style == "NONE" then + return {} + end - local result = {} - for token in string.gmatch(style, "([^,]+)") do - result[token] = true - end + local result = {} + for token in string.gmatch(style, "([^,]+)") do + result[token] = true + end - return result + return result end ---Get highlight opts for a given highlight group name ---@param name string ---@return table local function get_highlight(name) - local hl = vim.api.nvim_get_hl_by_name(name, true) - if hl.link then - return get_highlight(hl.link) - end + local hl = vim.api.nvim_get_hl_by_name(name, true) + if hl.link then + return get_highlight(hl.link) + end - local result = parse_style(hl.style) - result.fg = hl.foreground and hex(hl.foreground) - result.bg = hl.background and hex(hl.background) - result.sp = hl.special and hex(hl.special) + local result = parse_style(hl.style) + result.fg = hl.foreground and hex(hl.foreground) + result.bg = hl.background and hex(hl.background) + result.sp = hl.special and hex(hl.special) - return result + return result end ---Set highlight group from provided table ---@param groups table local function set_highlights(groups) - for group, opts in pairs(groups) do - vim.api.nvim_set_hl(0, group, opts) - end + for group, opts in pairs(groups) do + vim.api.nvim_set_hl(0, group, opts) + end end ---Generate a color palette from the current applied colorscheme @@ -92,18 +92,18 @@ local function generate_pallet_from_colorscheme() white = { index = 7, default = "#dfdfe0" }, } - local pallet = {} - for name, value in pairs(color_map) do - local global_name = "terminal_color_" .. value.index - pallet[name] = vim.g[global_name] and vim.g[global_name] or value.default - end + local pallet = {} + for name, value in pairs(color_map) do + local global_name = "terminal_color_" .. value.index + pallet[name] = vim.g[global_name] and vim.g[global_name] or value.default + end - pallet.sl = get_highlight("StatusLine") - pallet.tab = get_highlight("TabLine") - pallet.sel = get_highlight("TabLineSel") - pallet.fill = get_highlight("TabLineFill") + pallet.sl = get_highlight("StatusLine") + pallet.tab = get_highlight("TabLine") + pallet.sel = get_highlight("TabLineSel") + pallet.fill = get_highlight("TabLineFill") - return pallet + return pallet end ---Generate user highlight groups based on the curent applied colorscheme @@ -111,7 +111,7 @@ end ---NOTE: This is a global because I dont known where this file will be in your config ---and it is needed for the autocmd below _G._genreate_user_tabline_highlights = function() - local pal = generate_pallet_from_colorscheme() + local pal = generate_pallet_from_colorscheme() -- stylua: ignore local sl_colors = { @@ -125,32 +125,32 @@ _G._genreate_user_tabline_highlights = function() White = { fg = pal.white, bg = pal.black }, } - local colors = {} - for name, value in pairs(sl_colors) do - colors["User" .. name] = { fg = value.fg, bg = value.bg, bold = true } - colors["UserRv" .. name] = { fg = value.bg, bg = value.fg, bold = true } - end + local colors = {} + for name, value in pairs(sl_colors) do + colors["User" .. name] = { fg = value.fg, bg = value.bg, bold = true } + colors["UserRv" .. name] = { fg = value.bg, bg = value.fg, bold = true } + end - local groups = { - -- tabline - UserTLHead = { fg = pal.fill.bg, bg = pal.cyan }, - UserTLHeadSep = { fg = pal.cyan, bg = pal.fill.bg }, - UserTLActive = { fg = pal.sel.fg, bg = pal.sel.bg, bold = true }, - UserTLActiveSep = { fg = pal.sel.bg, bg = pal.fill.bg }, - UserTLBoldLine = { fg = pal.tab.fg, bg = pal.tab.bg, bold = true }, - UserTLLineSep = { fg = pal.tab.bg, bg = pal.fill.bg }, - } + local groups = { + -- tabline + UserTLHead = { fg = pal.fill.bg, bg = pal.cyan }, + UserTLHeadSep = { fg = pal.cyan, bg = pal.fill.bg }, + UserTLActive = { fg = pal.sel.fg, bg = pal.sel.bg, bold = true }, + UserTLActiveSep = { fg = pal.sel.bg, bg = pal.fill.bg }, + UserTLBoldLine = { fg = pal.tab.fg, bg = pal.tab.bg, bold = true }, + UserTLLineSep = { fg = pal.tab.bg, bg = pal.fill.bg }, + } - set_highlights(vim.tbl_extend("force", colors, groups)) + set_highlights(vim.tbl_extend("force", colors, groups)) end _genreate_user_tabline_highlights() vim.api.nvim_create_augroup("UserTablineHighlightGroups", { clear = true }) vim.api.nvim_create_autocmd({ "SessionLoadPost", "ColorScheme" }, { - callback = function() - _genreate_user_tabline_highlights() - end, + callback = function() + _genreate_user_tabline_highlights() + end, }) ---------------------------------------------------------------------------------------------------- @@ -159,62 +159,62 @@ vim.api.nvim_create_autocmd({ "SessionLoadPost", "ColorScheme" }, { local filename = require("tabby.module.filename") local cwd = function() - return "  " .. vim.fn.fnamemodify(vim.fn.getcwd(), ":t") .. " " + return "  " .. vim.fn.fnamemodify(vim.fn.getcwd(), ":t") .. " " end local line = { - hl = "TabLineFill", - layout = "active_wins_at_tail", - head = { - { cwd, hl = "UserTLHead" }, - { "", hl = "UserTLHeadSep" }, - }, - active_tab = { - label = function(tabid) - return { - "  " .. tabid .. " ", - hl = "UserTLActive", - } - end, - left_sep = { "", hl = "UserTLActiveSep" }, - right_sep = { "", hl = "UserTLActiveSep" }, - }, - inactive_tab = { - label = function(tabid) - return { - "  " .. tabid .. " ", - hl = "UserTLBoldLine", - } - end, - left_sep = { "", hl = "UserTLLineSep" }, - right_sep = { "", hl = "UserTLLineSep" }, - }, - top_win = { - label = function(winid) - return { - "  " .. filename.unique(winid) .. " ", - hl = "TabLine", - } - end, - left_sep = { "", hl = "UserTLLineSep" }, - right_sep = { "", hl = "UserTLLineSep" }, - }, - win = { - label = function(winid) - return { - "  " .. filename.unique(winid) .. " ", - hl = "TabLine", - } - end, - left_sep = { "", hl = "UserTLLineSep" }, - right_sep = { "", hl = "UserTLLineSep" }, - }, - tail = { - { "", hl = "UserTLHeadSep" }, - { "  ", hl = "UserTLHead" }, - }, + hl = "TabLineFill", + layout = "active_wins_at_tail", + head = { + { cwd, hl = "UserTLHead" }, + { "", hl = "UserTLHeadSep" }, + }, + active_tab = { + label = function(tabid) + return { + "  " .. tabid .. " ", + hl = "UserTLActive", + } + end, + left_sep = { "", hl = "UserTLActiveSep" }, + right_sep = { "", hl = "UserTLActiveSep" }, + }, + inactive_tab = { + label = function(tabid) + return { + "  " .. tabid .. " ", + hl = "UserTLBoldLine", + } + end, + left_sep = { "", hl = "UserTLLineSep" }, + right_sep = { "", hl = "UserTLLineSep" }, + }, + top_win = { + label = function(winid) + return { + "  " .. filename.unique(winid) .. " ", + hl = "TabLine", + } + end, + left_sep = { "", hl = "UserTLLineSep" }, + right_sep = { "", hl = "UserTLLineSep" }, + }, + win = { + label = function(winid) + return { + "  " .. filename.unique(winid) .. " ", + hl = "TabLine", + } + end, + left_sep = { "", hl = "UserTLLineSep" }, + right_sep = { "", hl = "UserTLLineSep" }, + }, + tail = { + { "", hl = "UserTLHeadSep" }, + { "  ", hl = "UserTLHead" }, + }, } require("tabby").setup({ - tabline = line, + tabline = line, }) diff --git a/config/nvim/lua/config/telescope.lua b/config/nvim/lua/config/telescope.lua index 2e56906e..0a1cb7c0 100644 --- a/config/nvim/lua/config/telescope.lua +++ b/config/nvim/lua/config/telescope.lua @@ -1,32 +1,32 @@ -require('telescope.actions') -local trouble = require('trouble.providers.telescope') +require("telescope.actions") +local trouble = require("trouble.providers.telescope") -require('telescope').setup { - extensions = { - fzf = { - fuzzy = true, -- false will only do exact matching - override_generic_sorter = true, -- override the generic sorter - override_file_sorter = true, -- override the file sorter - case_mode = "smart_case", -- or "ignore_case" or "respect_case" - -- the default case_mode is "smart_case" - }, - aerial = { - show_nesting = { - ["_"] = false, - python = true, - json = true, - yaml = true, - }, - }, - }, - defaults = { - mappings = { - i = { [""] = trouble.open_with_trouble }, - n = { [""] = trouble.open_with_trouble }, - }, - }, -} +require("telescope").setup({ + extensions = { + fzf = { + fuzzy = true, -- false will only do exact matching + override_generic_sorter = true, -- override the generic sorter + override_file_sorter = true, -- override the file sorter + case_mode = "smart_case", -- or "ignore_case" or "respect_case" + -- the default case_mode is "smart_case" + }, + aerial = { + show_nesting = { + ["_"] = false, + python = true, + json = true, + yaml = true, + }, + }, + }, + defaults = { + mappings = { + i = { [""] = trouble.open_with_trouble }, + n = { [""] = trouble.open_with_trouble }, + }, + }, +}) -require('telescope').load_extension('fzf') -require('telescope').load_extension('notify') -require('telescope').load_extension('projects') +require("telescope").load_extension("fzf") +require("telescope").load_extension("notify") +require("telescope").load_extension("projects") diff --git a/config/nvim/lua/config/toggleterm.lua b/config/nvim/lua/config/toggleterm.lua index eff76d0d..c0156312 100644 --- a/config/nvim/lua/config/toggleterm.lua +++ b/config/nvim/lua/config/toggleterm.lua @@ -1,22 +1,22 @@ -require('toggleterm').setup { - direction = 'horizontal', - open_mapping = [[\t]], - size = function (term) - if term.direction == "horizontal" then - return 15 - elseif term.direction == "vertical" then - return vim.o.columns * 0.3 - end - end, - hide_numbers = true, -- hide the number column in toggleterm buffers - persist_size = false, - float_opts = { - border = 'curved', - }, - winbar = { - enabled = false, - name_formatter = function(term) -- term: Terminal - return term.name - end - }, -} +require("toggleterm").setup({ + direction = "horizontal", + open_mapping = [[\t]], + size = function(term) + if term.direction == "horizontal" then + return 15 + elseif term.direction == "vertical" then + return vim.o.columns * 0.3 + end + end, + hide_numbers = true, -- hide the number column in toggleterm buffers + persist_size = false, + float_opts = { + border = "curved", + }, + winbar = { + enabled = false, + name_formatter = function(term) -- term: Terminal + return term.name + end, + }, +}) diff --git a/config/nvim/lua/config/treesitter.lua b/config/nvim/lua/config/treesitter.lua index f3d863d3..96290073 100644 --- a/config/nvim/lua/config/treesitter.lua +++ b/config/nvim/lua/config/treesitter.lua @@ -1,7 +1,7 @@ -require 'nvim-treesitter.configs'.setup { - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - disable = { 'help', 'fortran' }, - }, -} +require("nvim-treesitter.configs").setup({ + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + disable = { "help", "fortran" }, + }, +}) diff --git a/config/nvim/lua/config/trouble.lua b/config/nvim/lua/config/trouble.lua index 222285fc..88370259 100644 --- a/config/nvim/lua/config/trouble.lua +++ b/config/nvim/lua/config/trouble.lua @@ -1,47 +1,47 @@ -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", -- previous item - next = "j" -- next item - }, - indent_lines = true, -- add an indent guide below the fold icons - auto_open = false, -- automatically open the list when you have diagnostics - auto_close = true, -- 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 = false, -- enabling this will use the signs defined in your lsp client -} +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", -- previous item + next = "j", -- next item + }, + indent_lines = true, -- add an indent guide below the fold icons + auto_open = false, -- automatically open the list when you have diagnostics + auto_close = true, -- 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 = false, -- enabling this will use the signs defined in your lsp client +}) diff --git a/config/nvim/lua/keymaps.lua b/config/nvim/lua/keymaps.lua index a1354787..715c2ef1 100644 --- a/config/nvim/lua/keymaps.lua +++ b/config/nvim/lua/keymaps.lua @@ -1,39 +1,39 @@ -vim.g.mapleader = ' ' -vim.keymap.set('i', 'jk', '') +vim.g.mapleader = " " +vim.keymap.set("i", "jk", "") -- Toggleterm -vim.keymap.set('n', 'th', 'ToggleTerm direction=horizontal') -vim.keymap.set('n', 'tv', 'ToggleTerm direction=vertical') -vim.keymap.set('n', 'tf', 'ToggleTerm direction=float') -vim.keymap.set('n', 'tt', 'ToggleTerm direction=tab') +vim.keymap.set("n", "th", "ToggleTerm direction=horizontal") +vim.keymap.set("n", "tv", "ToggleTerm direction=vertical") +vim.keymap.set("n", "tf", "ToggleTerm direction=float") +vim.keymap.set("n", "tt", "ToggleTerm direction=tab") -- Aerial -vim.keymap.set('n', 'aa', 'AerialToggle') +vim.keymap.set("n", "aa", "AerialToggle") -- Telescope -vim.keymap.set('n', ';', 'Telescope builtin') -vim.keymap.set('n', 'ff', 'Telescope find_files') -vim.keymap.set('n', 'fg', 'Telescope live_grep') -vim.keymap.set('n', 'fp', 'Telescope projects') -vim.keymap.set('n', 'fa', 'Telescope aerial') -vim.keymap.set('n', 'fl', 'Telescope lsp_document_symbols') -vim.keymap.set('n', 'fe', 'Telescope diagnostics') -vim.keymap.set('n', 'fs', 'Telescope treesitter') -vim.keymap.set('n', 'fz', 'Telescope current_buffer_fuzzy_find') +vim.keymap.set("n", ";", "Telescope builtin") +vim.keymap.set("n", "ff", "Telescope find_files") +vim.keymap.set("n", "fg", "Telescope live_grep") +vim.keymap.set("n", "fp", "Telescope projects") +vim.keymap.set("n", "fa", "Telescope aerial") +vim.keymap.set("n", "fl", "Telescope lsp_document_symbols") +vim.keymap.set("n", "fe", "Telescope diagnostics") +vim.keymap.set("n", "fs", "Telescope treesitter") +vim.keymap.set("n", "fz", "Telescope current_buffer_fuzzy_find") -- Nvim-tree -vim.keymap.set('n', 'n', 'NvimTreeToggle') +vim.keymap.set("n", "n", "NvimTreeToggle") -- Trouble -vim.keymap.set('n', 'xx', 'TroubleToggle') -vim.keymap.set('n', 'xw', 'TroubleToggle workspace_diagnostics') -vim.keymap.set('n', 'xd', 'TroubleToggle document_diagnostics') -vim.keymap.set('n', 'xq', 'TroubleToggle quickfix') -vim.keymap.set('n', 'xl', 'TroubleToggle loclist') +vim.keymap.set("n", "xx", "TroubleToggle") +vim.keymap.set("n", "xw", "TroubleToggle workspace_diagnostics") +vim.keymap.set("n", "xd", "TroubleToggle document_diagnostics") +vim.keymap.set("n", "xq", "TroubleToggle quickfix") +vim.keymap.set("n", "xl", "TroubleToggle loclist") -- Navigator -vim.keymap.set({'n', 't'}, '', 'NavigatorLeft') -vim.keymap.set({'n', 't'}, '', 'NavigatorRight') -vim.keymap.set({'n', 't'}, '', 'NavigatorUp') -vim.keymap.set({'n', 't'}, '', 'NavigatorDown') -vim.keymap.set({'n', 't'}, '', 'NavigatorPrevious') +vim.keymap.set({ "n", "t" }, "", "NavigatorLeft") +vim.keymap.set({ "n", "t" }, "", "NavigatorRight") +vim.keymap.set({ "n", "t" }, "", "NavigatorUp") +vim.keymap.set({ "n", "t" }, "", "NavigatorDown") +vim.keymap.set({ "n", "t" }, "", "NavigatorPrevious") diff --git a/config/nvim/lua/options.lua b/config/nvim/lua/options.lua index 75658458..4c42013c 100644 --- a/config/nvim/lua/options.lua +++ b/config/nvim/lua/options.lua @@ -1,17 +1,17 @@ vim.opt.title = true -vim.g.python3_host_prog = '/usr/bin/python3' +vim.g.python3_host_prog = "/usr/bin/python3" vim.g.python_indent = { - open_paren = 'shiftwidth()', - nested_paren = 'shiftwidth()', - continue = 'shiftwidth()', - closed_paren_align_last_line = 'v:false', + open_paren = "shiftwidth()", + nested_paren = "shiftwidth()", + continue = "shiftwidth()", + closed_paren_align_last_line = "v:false", } vim.opt.termguicolors = true vim.opt.mouse = "nv" vim.opt.shiftwidth = 4 vim.opt.number = true vim.opt.relativenumber = true -vim.opt.listchars = { trail = '.', tab = '>_' } +vim.opt.listchars = { trail = ".", tab = ">_" } vim.opt.list = true vim.opt.wrap = true vim.opt.linebreak = true diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index 0a4dfe71..98d71ee7 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -5,153 +5,153 @@ vim.cmd([[ augroup end ]]) -require('packer').startup { - function(use) - use 'wbthomason/packer.nvim' - use 'lewis6991/impatient.nvim' - use 'stevearc/dressing.nvim' - use { - "EdenEast/nightfox.nvim", - config = function () - require 'config.nightfox' - end - } - use { - 'nanozuki/tabby.nvim', - config = function () - require 'config.tabby' - end - } - use { - 'rcarriga/nvim-notify', - config = function() - require("notify").setup { - background_colour = "#282c34", - } - vim.notify = require("notify") - end - } - use { - 'vigoux/notifier.nvim', - config = function () - require('notifier') - end - } - use 'kyazdani42/nvim-web-devicons' - use 'nvim-lua/plenary.nvim' - use { - 'neovim/nvim-lspconfig', - 'https://github.com/nvim-lua/lsp-status.nvim.git', - 'hrsh7th/nvim-cmp', - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-path', - 'hrsh7th/cmp-cmdline', - 'f3fora/cmp-spell', - 'petertriho/cmp-git', - 'Dosx001/cmp-commit', - 'kdheepak/cmp-latex-symbols', - 'L3MON4D3/LuaSnip', - 'saadparwaiz1/cmp_luasnip', - 'rafamadriz/friendly-snippets', - 'windwp/nvim-autopairs', - 'https://github.com/jose-elias-alvarez/null-ls.nvim', - } - use { - 'nvim-treesitter/nvim-treesitter', - config = function() - require 'config.treesitter' - end - } - use { - "ThePrimeagen/refactoring.nvim", - requires = { - {"nvim-lua/plenary.nvim"}, - {"nvim-treesitter/nvim-treesitter"} - }, - config = function () - require("refactoring").setup() - end - } - use { - 'tpope/vim-fugitive', - } - use { - 'https://github.com/lewis6991/gitsigns.nvim.git', - config = function() - require 'config.gitsigns' - end - } - use { - 'feline-nvim/feline.nvim', - config = function () - require 'config.feline' - end - } - use { - 'kyazdani42/nvim-tree.lua', - config = function() - require 'config.nvim-tree' - end - } - use { - "ahmedkhalf/project.nvim", - config = function() - require 'config.project' - end - } - use { - 'akinsho/toggleterm.nvim', - tag = 'v2.*', - config = function() - require 'config.toggleterm' - end - } - use { - 'nvim-telescope/telescope-fzf-native.nvim', - run = 'make' - } - use { - 'nvim-telescope/telescope.nvim', - branch = '0.1.x', - requires = { - { 'nvim-lua/plenary.nvim' } - }, - config = function() - require 'config.telescope' - end - } - use { - 'folke/trouble.nvim', - config = function() - require 'config.trouble' - end - } - use { - "lukas-reineke/indent-blankline.nvim", - config = function() - require('indent_blankline').setup { - show_current_context = true, - show_current_context_start = false, - } - end - } - use { - 'numToStr/Navigator.nvim', - config = function() - require('Navigator').setup { - mux = 'auto' - } - end - } - end, - config = { - display = { - open_fn = function() - return require('packer.util').float({ border = 'single' }) - end - }, - } -} -require 'config.lsp' -require 'config.cmp' +require("packer").startup({ + function(use) + use("wbthomason/packer.nvim") + use("lewis6991/impatient.nvim") + use("stevearc/dressing.nvim") + use({ + "EdenEast/nightfox.nvim", + config = function() + require("config.nightfox") + end, + }) + use({ + "nanozuki/tabby.nvim", + config = function() + require("config.tabby") + end, + }) + use({ + "rcarriga/nvim-notify", + config = function() + require("notify").setup({ + background_colour = "#282c34", + }) + vim.notify = require("notify") + end, + }) + use({ + "vigoux/notifier.nvim", + config = function() + require("notifier") + end, + }) + use("kyazdani42/nvim-web-devicons") + use("nvim-lua/plenary.nvim") + use({ + "neovim/nvim-lspconfig", + "https://github.com/nvim-lua/lsp-status.nvim.git", + "hrsh7th/nvim-cmp", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "f3fora/cmp-spell", + "petertriho/cmp-git", + "Dosx001/cmp-commit", + "kdheepak/cmp-latex-symbols", + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets", + "windwp/nvim-autopairs", + "https://github.com/jose-elias-alvarez/null-ls.nvim", + }) + use({ + "nvim-treesitter/nvim-treesitter", + config = function() + require("config.treesitter") + end, + }) + use({ + "ThePrimeagen/refactoring.nvim", + requires = { + { "nvim-lua/plenary.nvim" }, + { "nvim-treesitter/nvim-treesitter" }, + }, + config = function() + require("refactoring").setup() + end, + }) + use({ + "tpope/vim-fugitive", + }) + use({ + "https://github.com/lewis6991/gitsigns.nvim.git", + config = function() + require("config.gitsigns") + end, + }) + use({ + "feline-nvim/feline.nvim", + config = function() + require("config.feline") + end, + }) + use({ + "kyazdani42/nvim-tree.lua", + config = function() + require("config.nvim-tree") + end, + }) + use({ + "ahmedkhalf/project.nvim", + config = function() + require("config.project") + end, + }) + use({ + "akinsho/toggleterm.nvim", + tag = "v2.*", + config = function() + require("config.toggleterm") + end, + }) + use({ + "nvim-telescope/telescope-fzf-native.nvim", + run = "make", + }) + use({ + "nvim-telescope/telescope.nvim", + branch = "0.1.x", + requires = { + { "nvim-lua/plenary.nvim" }, + }, + config = function() + require("config.telescope") + end, + }) + use({ + "folke/trouble.nvim", + config = function() + require("config.trouble") + end, + }) + use({ + "lukas-reineke/indent-blankline.nvim", + config = function() + require("indent_blankline").setup({ + show_current_context = true, + show_current_context_start = false, + }) + end, + }) + use({ + "numToStr/Navigator.nvim", + config = function() + require("Navigator").setup({ + mux = "auto", + }) + end, + }) + end, + config = { + display = { + open_fn = function() + return require("packer.util").float({ border = "single" }) + end, + }, + }, +}) +require("config.lsp") +require("config.cmp") diff --git a/config/nvim/lua/vimcommands.lua b/config/nvim/lua/vimcommands.lua index 466f495b..d168b703 100644 --- a/config/nvim/lua/vimcommands.lua +++ b/config/nvim/lua/vimcommands.lua @@ -1,6 +1,6 @@ -- TODO convert to lua vim.cmd("let &t_ut=''") -- For kitty background colour support -vim.cmd [[ +vim.cmd([[ au BufRead,BufNewFile *.ipynb setlocal filetype=json au BufRead,BufNewFile *.md setlocal spell au BufRead,BufNewFile *.code-workspace setlocal filetype=json @@ -8,4 +8,4 @@ au BufRead,BufNewFile *.csv setlocal nowrap au BufRead,BufNewFile *.service[a-zA-Z0-9]* setlocal filetype=systemd au TermOpen * setlocal nonumber norelativenumber syntax on -]] +]]) diff --git a/pkglist.txt b/pkglist.txt index 1699548e..ce9e3bf2 100644 --- a/pkglist.txt +++ b/pkglist.txt @@ -2,7 +2,7 @@ fzf lazygit lua-language-server neovim -pyenv +prettier python python-black python-isort @@ -13,6 +13,8 @@ python-pre-commit python-pynvim python-virtualenv ripgrep +shfmt +stylua tmux tree-sitter wezterm