Add a few more formatters, run formatting on files

This commit is contained in:
Evie Litherland-Smith 2023-02-13 12:57:12 +00:00
parent d3ed6bae04
commit ac62702feb
20 changed files with 1035 additions and 999 deletions

View file

@ -1,7 +1,9 @@
# Personal dotfiles # Personal dotfiles
Collection of various settings, configurations and other miscellaneous tools. Collection of various settings, configurations and other miscellaneous tools.
## Settings ## Settings
- [neovim](https://neovim.io) - [neovim](https://neovim.io)
- [kitty](https://sw.kovidgoyal.net/kitty/) - [kitty](https://sw.kovidgoyal.net/kitty/)
- [lazygit](https://github.com/jesseduffield/lazygit) - [lazygit](https://github.com/jesseduffield/lazygit)
@ -11,9 +13,11 @@ Collection of various settings, configurations and other miscellaneous tools.
- [zsh]() paths and aliases - [zsh]() paths and aliases
## Fonts ## Fonts
- [NerdFonts symbols](https://github.com/ryanoasis/nerd-fonts) - [NerdFonts symbols](https://github.com/ryanoasis/nerd-fonts)
## Binaries ## Binaries
- [EFM LSP]() - [EFM LSP]()
- [Lazygit]() - [Lazygit]()
- [Lua LSP]() - [Lua LSP]()
@ -22,11 +26,13 @@ Collection of various settings, configurations and other miscellaneous tools.
- [Treesitter]() - [Treesitter]()
## Templates ## Templates
- SSH config - SSH config
- Python package - Python package
- Crontab - Crontab
## Installation ## Installation
Run `make` to symlink configs and download extras. Run `make` to symlink configs and download extras.
`software.sh` (WIP) installs common programs. `software.sh` (WIP) installs common programs.

View file

@ -1,7 +1,9 @@
# Vim config # Vim config
Personal configuration and plugins for Vim Personal configuration and plugins for Vim
## Installing neovim AppImage ## Installing neovim AppImage
```bash ```bash
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
chmod u+x nvim.appimage chmod u+x nvim.appimage
@ -9,23 +11,29 @@ mv nvim.appimage "$HOME/bin/nvim"
``` ```
## Installing configuration ## Installing configuration
```bash ```bash
ln -s /path/to/config/nvim ${XDG_CONFIG_HOME:-$HOME/.config}/nvim ln -s /path/to/config/nvim ${XDG_CONFIG_HOME:-$HOME/.config}/nvim
``` ```
### Install script ### Install script
`install.sh` currently handles installing `Packer` and `pynvim`. `install.sh` currently handles installing `Packer` and `pynvim`.
Will also update existing installs if already present. Will also update existing installs if already present.
### Installing `Packer` plugin manager ### Installing `Packer` plugin manager
```bash ```bash
git clone --depth 1 https://github.com/wbthomason/packer.nvim\ git clone --depth 1 https://github.com/wbthomason/packer.nvim\
$HOME/.local/share/nvim/site/pack/packer/start/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 Plugin definitions are in `plugins.lua`, inside `vim` run `:PackerSync` to install plugins
## Enabling python support ## Enabling python support
Set up neovim specific virtual environment to install `pynvim` package: Set up neovim specific virtual environment to install `pynvim` package:
```bash ```bash
python3 -m venv "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/venv" python3 -m venv "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/venv"
source "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/venv/bin/activate" source "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/venv/bin/activate"
@ -34,6 +42,7 @@ source deactivate
``` ```
### Installing language servers using `pipx` ### Installing language servers using `pipx`
Install [pipx](https://pypa.github.io/pipx/) in chosen manner, e.g. as given in documentation: Install [pipx](https://pypa.github.io/pipx/) in chosen manner, e.g. as given in documentation:
```bash ```bash
@ -52,4 +61,5 @@ pipx install zimports
``` ```
## Add LUA language server ## Add LUA language server
Follow instructions from [sumneko/lua-language-server GitHub](https://github.com/sumneko/lua-language-server/wiki/Getting-Started#command-line). Follow instructions from [sumneko/lua-language-server GitHub](https://github.com/sumneko/lua-language-server/wiki/Getting-Started#command-line).

View file

@ -1,11 +1,11 @@
-- Set vim options -- Set vim options
require 'options' require("options")
-- Load plugins as defined for Packer -- Load plugins as defined for Packer
require 'plugins' require("plugins")
-- Define custom keymappings -- Define custom keymappings
require 'keymaps' require("keymaps")
-- Remaining vim commands to be converted to lua -- Remaining vim commands to be converted to lua
require 'vimcommands' require("vimcommands")

View file

@ -1,75 +1,75 @@
local cmp = require 'cmp' local cmp = require("cmp")
local luasnip = require 'luasnip' local luasnip = require("luasnip")
require('luasnip.loaders.from_vscode').lazy_load() require("luasnip.loaders.from_vscode").lazy_load()
cmp.setup({ cmp.setup({
snippet = { snippet = {
expand = function(args) expand = function(args)
luasnip.lsp_expand(args.body) -- For `luasnip` users. luasnip.lsp_expand(args.body) -- For `luasnip` users.
end, end,
}, },
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
['<C-u>'] = cmp.mapping.scroll_docs(-4), -- Up ["<C-u>"] = cmp.mapping.scroll_docs(-4), -- Up
['<C-d>'] = cmp.mapping.scroll_docs(4), -- Down ["<C-d>"] = cmp.mapping.scroll_docs(4), -- Down
['<C-Space>'] = cmp.mapping.complete(), ["<C-Space>"] = cmp.mapping.complete(),
['<CR>'] = cmp.mapping.confirm { ["<CR>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace, behavior = cmp.ConfirmBehavior.Replace,
select = true, select = true,
}, }),
['<Tab>'] = cmp.mapping(function(fallback) ["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_next_item() cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump() luasnip.expand_or_jump()
else else
fallback() fallback()
end end
end, { 'i', 's' }), end, { "i", "s" }),
['<S-Tab>'] = cmp.mapping(function(fallback) ["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_prev_item() cmp.select_prev_item()
elseif luasnip.jumpable(-1) then elseif luasnip.jumpable(-1) then
luasnip.jump(-1) luasnip.jump(-1)
else else
fallback() fallback()
end end
end, { 'i', 's' }), end, { "i", "s" }),
}), }),
sources = { sources = {
{ name = 'nvim_lsp' }, { name = "nvim_lsp" },
{ name = 'luasnip' }, { name = "luasnip" },
{ name = 'latex_symbols' }, { name = "latex_symbols" },
} },
}) })
-- Set configuration for specific filetype. -- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', { cmp.setup.filetype("gitcommit", {
sources = { sources = {
{ name = 'git' }, { name = "git" },
{ name = 'commit' }, { name = "commit" },
{ name = 'buffer' }, { name = "buffer" },
} },
}) })
cmp.setup.filetype('markdown', { cmp.setup.filetype("markdown", {
sources = { sources = {
{ name = 'spell' }, { name = "spell" },
{ name = 'buffer' }, { name = "buffer" },
}, },
}) })
cmp.setup.cmdline('/', { cmp.setup.cmdline("/", {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = { sources = {
{ name = 'buffer' } { name = "buffer" },
} },
}) })
cmp.setup.cmdline(':', { cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = { sources = {
{ name = 'path' }, { name = "path" },
{ name = 'cmdline' } { name = "cmdline" },
} },
}) })

View file

@ -31,50 +31,50 @@ local fmt = string.format
---@param n number ---@param n number
---@return string ---@return string
local hex = function(n) local hex = function(n)
if n then if n then
return fmt("#%06x", n) return fmt("#%06x", n)
end end
end end
---Parse `style` string into nvim_set_hl options ---Parse `style` string into nvim_set_hl options
---@param style string ---@param style string
---@return table ---@return table
local function parse_style(style) local function parse_style(style)
if not style or style == "NONE" then if not style or style == "NONE" then
return {} return {}
end end
local result = {} local result = {}
for token in string.gmatch(style, "([^,]+)") do for token in string.gmatch(style, "([^,]+)") do
result[token] = true result[token] = true
end end
return result return result
end end
---Get highlight opts for a given highlight group name ---Get highlight opts for a given highlight group name
---@param name string ---@param name string
---@return table ---@return table
local function get_highlight(name) local function get_highlight(name)
local hl = vim.api.nvim_get_hl_by_name(name, true) local hl = vim.api.nvim_get_hl_by_name(name, true)
if hl.link then if hl.link then
return get_highlight(hl.link) return get_highlight(hl.link)
end end
local result = parse_style(hl.style) local result = parse_style(hl.style)
result.fg = hl.foreground and hex(hl.foreground) result.fg = hl.foreground and hex(hl.foreground)
result.bg = hl.background and hex(hl.background) result.bg = hl.background and hex(hl.background)
result.sp = hl.special and hex(hl.special) result.sp = hl.special and hex(hl.special)
return result return result
end end
---Set highlight group from provided table ---Set highlight group from provided table
---@param groups table ---@param groups table
local function set_highlights(groups) local function set_highlights(groups)
for group, opts in pairs(groups) do for group, opts in pairs(groups) do
vim.api.nvim_set_hl(0, group, opts) vim.api.nvim_set_hl(0, group, opts)
end end
end end
---Generate a color palette from the current applied colorscheme ---Generate a color palette from the current applied colorscheme
@ -92,27 +92,27 @@ local function generate_pallet_from_colorscheme()
white = { index = 7, default = "#dfdfe0" }, white = { index = 7, default = "#dfdfe0" },
} }
local diagnostic_map = { local diagnostic_map = {
hint = { hl = "DiagnosticHint", default = color_map.green.default }, hint = { hl = "DiagnosticHint", default = color_map.green.default },
info = { hl = "DiagnosticInfo", default = color_map.blue.default }, info = { hl = "DiagnosticInfo", default = color_map.blue.default },
warn = { hl = "DiagnosticWarn", default = color_map.yellow.default }, warn = { hl = "DiagnosticWarn", default = color_map.yellow.default },
error = { hl = "DiagnosticError", default = color_map.red.default }, error = { hl = "DiagnosticError", default = color_map.red.default },
} }
local pallet = {} local pallet = {}
for name, value in pairs(color_map) do for name, value in pairs(color_map) do
local global_name = "terminal_color_" .. value.index local global_name = "terminal_color_" .. value.index
pallet[name] = vim.g[global_name] and vim.g[global_name] or value.default pallet[name] = vim.g[global_name] and vim.g[global_name] or value.default
end end
for name, value in pairs(diagnostic_map) do for name, value in pairs(diagnostic_map) do
pallet[name] = get_highlight(value.hl).fg or value.default pallet[name] = get_highlight(value.hl).fg or value.default
end end
pallet.sl = get_highlight("StatusLine") pallet.sl = get_highlight("StatusLine")
pallet.sel = get_highlight("TabLineSel") pallet.sel = get_highlight("TabLineSel")
return pallet return pallet
end end
---Generate user highlight groups based on the curent applied colorscheme ---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 ---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 ---and it is needed for the autocmd below
_G._generate_user_statusline_highlights = function() _G._generate_user_statusline_highlights = function()
local pal = generate_pallet_from_colorscheme() local pal = generate_pallet_from_colorscheme()
-- stylua: ignore -- stylua: ignore
local sl_colors = { local sl_colors = {
@ -134,332 +134,333 @@ _G._generate_user_statusline_highlights = function()
White = { fg = pal.white, bg = pal.black }, White = { fg = pal.white, bg = pal.black },
} }
local colors = {} local colors = {}
for name, value in pairs(sl_colors) do for name, value in pairs(sl_colors) do
colors["User" .. name] = { fg = value.fg, bg = value.bg, bold = true } colors["User" .. name] = { fg = value.fg, bg = value.bg, bold = true }
colors["UserRv" .. name] = { fg = value.bg, bg = value.fg, bold = true } colors["UserRv" .. name] = { fg = value.bg, bg = value.fg, bold = true }
end 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 = { local groups = {
-- statusline -- statusline
UserSLHint = { fg = pal.sl.bg, bg = pal.hint, bold = true }, UserSLHint = { fg = pal.sl.bg, bg = pal.hint, bold = true },
UserSLInfo = { fg = pal.sl.bg, bg = pal.info, bold = true }, UserSLInfo = { fg = pal.sl.bg, bg = pal.info, bold = true },
UserSLWarn = { fg = pal.sl.bg, bg = pal.warn, bold = true }, UserSLWarn = { fg = pal.sl.bg, bg = pal.warn, bold = true },
UserSLError = { fg = pal.sl.bg, bg = pal.error, bold = true }, UserSLError = { fg = pal.sl.bg, bg = pal.error, bold = true },
UserSLStatus = { fg = status.fg, bg = status.bg, bold = true }, UserSLStatus = { fg = status.fg, bg = status.bg, bold = true },
UserSLFtHint = { fg = pal.sel.bg, bg = pal.hint }, UserSLFtHint = { fg = pal.sel.bg, bg = pal.hint },
UserSLHintInfo = { fg = pal.hint, bg = pal.info }, UserSLHintInfo = { fg = pal.hint, bg = pal.info },
UserSLInfoWarn = { fg = pal.info, bg = pal.warn }, UserSLInfoWarn = { fg = pal.info, bg = pal.warn },
UserSLWarnError = { fg = pal.warn, bg = pal.error }, UserSLWarnError = { fg = pal.warn, bg = pal.error },
UserSLErrorStatus = { fg = pal.error, bg = status.bg }, UserSLErrorStatus = { fg = pal.error, bg = status.bg },
UserSLStatusBg = { fg = status.bg, bg = pal.sl.bg }, UserSLStatusBg = { fg = status.bg, bg = pal.sl.bg },
UserSLAlt = pal.sel, UserSLAlt = pal.sel,
UserSLAltSep = { fg = pal.sl.bg, bg = pal.sel.bg }, UserSLAltSep = { fg = pal.sl.bg, bg = pal.sel.bg },
UserSLGitBranch = { fg = pal.yellow, bg = pal.sl.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 end
_generate_user_statusline_highlights() _generate_user_statusline_highlights()
vim.api.nvim_create_augroup("UserStatuslineHighlightGroups", { clear = true }) vim.api.nvim_create_augroup("UserStatuslineHighlightGroups", { clear = true })
vim.api.nvim_create_autocmd({ "SessionLoadPost", "ColorScheme" }, { vim.api.nvim_create_autocmd({ "SessionLoadPost", "ColorScheme" }, {
callback = function() callback = function()
_generate_user_statusline_highlights() _generate_user_statusline_highlights()
end, end,
}) })
---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
-- Feline -- Feline
local vi = { local vi = {
-- Map vi mode to text name -- Map vi mode to text name
text = { text = {
n = "NORMAL", n = "NORMAL",
no = "NORMAL", no = "NORMAL",
i = "INSERT", i = "INSERT",
v = "VISUAL", v = "VISUAL",
V = "V-LINE", V = "V-LINE",
[""] = "V-BLOCK", [""] = "V-BLOCK",
c = "COMMAND", c = "COMMAND",
cv = "COMMAND", cv = "COMMAND",
ce = "COMMAND", ce = "COMMAND",
R = "REPLACE", R = "REPLACE",
Rv = "REPLACE", Rv = "REPLACE",
s = "SELECT", s = "SELECT",
S = "SELECT", S = "SELECT",
[""] = "SELECT", [""] = "SELECT",
t = "TERMINAL", t = "TERMINAL",
}, },
-- Maps vi mode to highlight group color defined above -- Maps vi mode to highlight group color defined above
colors = { colors = {
n = "UserRvCyan", n = "UserRvCyan",
no = "UserRvCyan", no = "UserRvCyan",
i = "UserSLStatus", i = "UserSLStatus",
v = "UserRvMagenta", v = "UserRvMagenta",
V = "UserRvMagenta", V = "UserRvMagenta",
[""] = "UserRvMagenta", [""] = "UserRvMagenta",
R = "UserRvRed", R = "UserRvRed",
Rv = "UserRvRed", Rv = "UserRvRed",
r = "UserRvBlue", r = "UserRvBlue",
rm = "UserRvBlue", rm = "UserRvBlue",
s = "UserRvMagenta", s = "UserRvMagenta",
S = "UserRvMagenta", S = "UserRvMagenta",
[""] = "FelnMagenta", [""] = "FelnMagenta",
c = "UserRvYellow", c = "UserRvYellow",
["!"] = "UserRvBlue", ["!"] = "UserRvBlue",
t = "UserRvBlue", t = "UserRvBlue",
}, },
-- Maps vi mode to seperator highlight goup defined above -- Maps vi mode to seperator highlight goup defined above
sep = { sep = {
n = "UserCyan", n = "UserCyan",
no = "UserCyan", no = "UserCyan",
i = "UserSLStatusBg", i = "UserSLStatusBg",
v = "UserMagenta", v = "UserMagenta",
V = "UserMagenta", V = "UserMagenta",
[""] = "UserMagenta", [""] = "UserMagenta",
R = "UserRed", R = "UserRed",
Rv = "UserRed", Rv = "UserRed",
r = "UserBlue", r = "UserBlue",
rm = "UserBlue", rm = "UserBlue",
s = "UserMagenta", s = "UserMagenta",
S = "UserMagenta", S = "UserMagenta",
[""] = "FelnMagenta", [""] = "FelnMagenta",
c = "UserYellow", c = "UserYellow",
["!"] = "UserBlue", ["!"] = "UserBlue",
t = "UserBlue", t = "UserBlue",
}, },
} }
local icons = { local icons = {
locker = "", -- #f023 locker = "", -- #f023
page = "", -- 2630 page = "", -- 2630
line_number = "", -- e0a1 line_number = "", -- e0a1
connected = "", -- f817 connected = "", -- f817
dos = "", -- e70f dos = "", -- e70f
unix = "", -- f17c unix = "", -- f17c
mac = "", -- f179 mac = "", -- f179
mathematical_L = "𝑳", mathematical_L = "𝑳",
vertical_bar = "", vertical_bar = "",
vertical_bar_thin = "", vertical_bar_thin = "",
left = "", left = "",
right = "", right = "",
block = "", block = "",
left_filled = "", left_filled = "",
right_filled = "", right_filled = "",
slant_left = "", slant_left = "",
slant_left_thin = "", slant_left_thin = "",
slant_right = "", slant_right = "",
slant_right_thin = "", slant_right_thin = "",
slant_left_2 = "", slant_left_2 = "",
slant_left_2_thin = "", slant_left_2_thin = "",
slant_right_2 = "", slant_right_2 = "",
slant_right_2_thin = "", slant_right_2_thin = "",
left_rounded = "", left_rounded = "",
left_rounded_thin = "", left_rounded_thin = "",
right_rounded = "", right_rounded = "",
right_rounded_thin = "", right_rounded_thin = "",
circle = "", circle = "",
} }
---Get the number of diagnostic messages for the provided severity ---Get the number of diagnostic messages for the provided severity
---@param str string [ERROR | WARN | INFO | HINT] ---@param str string [ERROR | WARN | INFO | HINT]
---@return string ---@return string
local function get_diag(str) local function get_diag(str)
local diagnostics = vim.diagnostic.get(0, { severity = vim.diagnostic.severity[str] }) local diagnostics = vim.diagnostic.get(0, { severity = vim.diagnostic.severity[str] })
local count = #diagnostics local count = #diagnostics
return (count > 0) and " " .. count .. " " or "" return (count > 0) and " " .. count .. " " or ""
end end
---Get highlight group from vi mode ---Get highlight group from vi mode
---@return string ---@return string
local function vi_mode_hl() local function vi_mode_hl()
return vi.colors[vim.fn.mode()] or "UserSLViBlack" return vi.colors[vim.fn.mode()] or "UserSLViBlack"
end end
---Get sep highlight group from vi mode ---Get sep highlight group from vi mode
local function vi_sep_hl() local function vi_sep_hl()
return vi.sep[vim.fn.mode()] or "UserSLBlack" return vi.sep[vim.fn.mode()] or "UserSLBlack"
end end
---Get the path of the file relative to the cwd ---Get the path of the file relative to the cwd
---@return string ---@return string
local function file_info() local function file_info()
local list = {} local list = {}
if vim.bo.readonly then if vim.bo.readonly then
table.insert(list, "🔒") table.insert(list, "🔒")
end end
if vim.bo.modified then if vim.bo.modified then
table.insert(list, "") table.insert(list, "")
end 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 end
-- Create a table that contians every status line commonent -- Create a table that contians every status line commonent
local c = { local c = {
vimode = { vimode = {
provider = function() provider = function()
return fmt(" %s ", vi.text[vim.fn.mode()]) return fmt(" %s ", vi.text[vim.fn.mode()])
end, end,
hl = vi_mode_hl, hl = vi_mode_hl,
right_sep = { str = "", hl = vi_sep_hl }, right_sep = { str = "", hl = vi_sep_hl },
}, },
gitbranch = { gitbranch = {
provider = "git_branch", provider = "git_branch",
icon = "", icon = "",
hl = "UserSLGitBranch", hl = "UserSLGitBranch",
right_sep = { str = " ", hl = "UserSLGitBranch" }, right_sep = { str = " ", hl = "UserSLGitBranch" },
enabled = function() enabled = function()
return vim.b.gitsigns_status_dict ~= nil return vim.b.gitsigns_status_dict ~= nil
end, end,
}, },
file_type = { file_type = {
provider = function() provider = function()
return fmt(" %s ", vim.bo.filetype:upper()) return fmt(" %s ", vim.bo.filetype:upper())
end, end,
hl = "UserSLAlt", hl = "UserSLAlt",
}, },
fileinfo = { fileinfo = {
provider = { name = "file_info", opts = { type = "relative" } }, provider = { name = "file_info", opts = { type = "relative" } },
hl = "UserSLAlt", hl = "UserSLAlt",
left_sep = { str = "", hl = "UserSLAltSep" }, left_sep = { str = "", hl = "UserSLAltSep" },
right_sep = { str = "", hl = "UserSLAltSep" }, right_sep = { str = "", hl = "UserSLAltSep" },
}, },
file_enc = { file_enc = {
provider = function() provider = function()
local os = icons[vim.bo.fileformat] or "" local os = icons[vim.bo.fileformat] or ""
return fmt(" %s %s ", os, vim.bo.fileencoding) return fmt(" %s %s ", os, vim.bo.fileencoding)
end, end,
hl = "StatusLine", hl = "StatusLine",
left_sep = { str = icons.left_filled, hl = "UserSLAltSep" }, left_sep = { str = icons.left_filled, hl = "UserSLAltSep" },
}, },
cur_position = { cur_position = {
provider = function() provider = function()
-- TODO: What about 4+ diget line numbers? -- TODO: What about 4+ diget line numbers?
return fmt(" %3d:%-2d ", unpack(vim.api.nvim_win_get_cursor(0))) return fmt(" %3d:%-2d ", unpack(vim.api.nvim_win_get_cursor(0)))
end, end,
hl = vi_mode_hl, hl = vi_mode_hl,
left_sep = { str = icons.left_filled, hl = vi_sep_hl }, left_sep = { str = icons.left_filled, hl = vi_sep_hl },
}, },
cur_percent = { cur_percent = {
provider = function() provider = function()
return " " .. require("feline.providers.cursor").line_percentage() .. " " return " " .. require("feline.providers.cursor").line_percentage() .. " "
end, end,
hl = vi_mode_hl, hl = vi_mode_hl,
left_sep = { str = icons.left, 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 default = { -- needed to pass the parent StatusLine hl group to right hand side
provider = "", provider = "",
hl = "StatusLine", hl = "StatusLine",
}, },
lsp_status = { lsp_status = {
provider = function() provider = function()
return require("lsp-status").status() return require("lsp-status").status()
end, end,
hl = "UserSLStatus", hl = "UserSLStatus",
left_sep = { str = "", hl = "UserSLStatusBg", always_visible = true }, left_sep = { str = "", hl = "UserSLStatusBg", always_visible = true },
right_sep = { str = "", hl = "UserSLErrorStatus", always_visible = true }, right_sep = { str = "", hl = "UserSLErrorStatus", always_visible = true },
}, },
lsp_error = { lsp_error = {
provider = function() provider = function()
return get_diag("ERROR") return get_diag("ERROR")
end, end,
hl = "UserSLError", hl = "UserSLError",
right_sep = { str = "", hl = "UserSLWarnError", always_visible = true }, right_sep = { str = "", hl = "UserSLWarnError", always_visible = true },
}, },
lsp_warn = { lsp_warn = {
provider = function() provider = function()
return get_diag("WARN") return get_diag("WARN")
end, end,
hl = "UserSLWarn", hl = "UserSLWarn",
right_sep = { str = "", hl = "UserSLInfoWarn", always_visible = true }, right_sep = { str = "", hl = "UserSLInfoWarn", always_visible = true },
}, },
lsp_info = { lsp_info = {
provider = function() provider = function()
return get_diag("INFO") return get_diag("INFO")
end, end,
hl = "UserSLInfo", hl = "UserSLInfo",
right_sep = { str = "", hl = "UserSLHintInfo", always_visible = true }, right_sep = { str = "", hl = "UserSLHintInfo", always_visible = true },
}, },
lsp_hint = { lsp_hint = {
provider = function() provider = function()
return get_diag("HINT") return get_diag("HINT")
end, end,
hl = "UserSLHint", hl = "UserSLHint",
right_sep = { str = "", hl = "UserSLFtHint", always_visible = true }, right_sep = { str = "", hl = "UserSLFtHint", always_visible = true },
}, },
in_fileinfo = { in_fileinfo = {
provider = "file_info", provider = "file_info",
hl = "StatusLine", hl = "StatusLine",
}, },
in_position = { in_position = {
provider = "position", provider = "position",
hl = "StatusLine", hl = "StatusLine",
}, },
} }
local active = { local active = {
{ -- left { -- left
c.vimode, c.vimode,
c.gitbranch, c.gitbranch,
c.fileinfo, c.fileinfo,
c.default, -- must be last c.default, -- must be last
}, },
{ -- right { -- right
c.lsp_status, c.lsp_status,
c.lsp_error, c.lsp_error,
c.lsp_warn, c.lsp_warn,
c.lsp_info, c.lsp_info,
c.lsp_hint, c.lsp_hint,
c.file_type, c.file_type,
c.file_enc, c.file_enc,
c.cur_position, c.cur_position,
c.cur_percent, c.cur_percent,
}, },
} }
local inactive = { local inactive = {
{ c.in_fileinfo }, -- left { c.in_fileinfo }, -- left
{ c.in_position }, -- right { c.in_position }, -- right
} }
require("feline").setup({ require("feline").setup({
components = { active = active, inactive = inactive }, components = { active = active, inactive = inactive },
highlight_reset_triggers = {}, highlight_reset_triggers = {},
force_inactive = { force_inactive = {
filetypes = { filetypes = {
"NvimTree", "NvimTree",
"Trouble", "Trouble",
"packer", "packer",
"dap-repl", "dap-repl",
"dapui_scopes", "dapui_scopes",
"dapui_stacks", "dapui_stacks",
"dapui_watches", "dapui_watches",
"dapui_repl", "dapui_repl",
"LspTrouble", "LspTrouble",
"qf", "qf",
"help", "help",
}, },
buftypes = { "terminal" }, buftypes = { "terminal" },
bufnames = {}, bufnames = {},
}, },
disable = { disable = {
filetypes = { filetypes = {
"dashboard", "dashboard",
"startify", "startify",
}, },
}, },
}) })

View file

@ -1,45 +1,57 @@
require('gitsigns').setup { require("gitsigns").setup({
signcolumn = true, signcolumn = true,
numhl = true, numhl = true,
linehl = false, linehl = false,
current_line_blame = true, current_line_blame = true,
word_diff = false, word_diff = false,
on_attach = function(bufnr) on_attach = function(bufnr)
local gs = package.loaded.gitsigns local gs = package.loaded.gitsigns
local function map(mode, l, r, opts) local function map(mode, l, r, opts)
opts = opts or {} opts = opts or {}
opts.buffer = bufnr opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts) vim.keymap.set(mode, l, r, opts)
end end
-- Navigation -- Navigation
map('n', ']c', function() map("n", "]c", function()
if vim.wo.diff then return ']c' end if vim.wo.diff then
vim.schedule(function() gs.next_hunk() end) return "]c"
return '<Ignore>' end
end, { expr = true }) vim.schedule(function()
gs.next_hunk()
end)
return "<Ignore>"
end, { expr = true })
map('n', '[c', function() map("n", "[c", function()
if vim.wo.diff then return '[c' end if vim.wo.diff then
vim.schedule(function() gs.prev_hunk() end) return "[c"
return '<Ignore>' end
end, { expr = true }) vim.schedule(function()
gs.prev_hunk()
end)
return "<Ignore>"
end, { expr = true })
-- Actions -- Actions
map({ 'n', 'v' }, '<leader>hs', ':Gitsigns stage_hunk<CR>') map({ "n", "v" }, "<leader>hs", ":Gitsigns stage_hunk<CR>")
map({ 'n', 'v' }, '<leader>hr', ':Gitsigns reset_hunk<CR>') map({ "n", "v" }, "<leader>hr", ":Gitsigns reset_hunk<CR>")
map('n', '<leader>hS', gs.stage_buffer) map("n", "<leader>hS", gs.stage_buffer)
map('n', '<leader>hu', gs.undo_stage_hunk) map("n", "<leader>hu", gs.undo_stage_hunk)
map('n', '<leader>hR', gs.reset_buffer) map("n", "<leader>hR", gs.reset_buffer)
map('n', '<leader>hp', gs.preview_hunk) map("n", "<leader>hp", gs.preview_hunk)
map('n', '<leader>hb', function() gs.blame_line { full = true } end) map("n", "<leader>hb", function()
map('n', '<leader>tb', gs.toggle_current_line_blame) gs.blame_line({ full = true })
map('n', '<leader>hd', gs.diffthis) end)
map('n', '<leader>hD', function() gs.diffthis('~') end) map("n", "<leader>tb", gs.toggle_current_line_blame)
map('n', '<leader>td', gs.toggle_deleted) map("n", "<leader>hd", gs.diffthis)
map("n", "<leader>hD", function()
gs.diffthis("~")
end)
map("n", "<leader>td", gs.toggle_deleted)
-- Text object -- Text object
map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>') map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>")
end, end,
} })

View file

@ -1,119 +1,124 @@
local lsp_status = require('lsp-status') local lsp_status = require("lsp-status")
lsp_status.config { lsp_status.config({
diagnostics = false, diagnostics = false,
} })
lsp_status.register_progress() 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. -- Mappings.
-- See `:help vim.diagnostic.*` for documentation on any of the below functions -- See `:help vim.diagnostic.*` for documentation on any of the below functions
local opts = { noremap = true, silent = true } local opts = { noremap = true, silent = true }
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, opts) vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, opts)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, 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", "]d", vim.diagnostic.goto_next, opts)
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, opts) vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, opts)
local signs = { Error = "", Warn = "", Hint = "", Info = "" } local signs = { Error = "", Warn = "", Hint = "", Info = "" }
for type, icon in pairs(signs) do for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end end
local lsp_formatting = function (bufnr) local lsp_formatting = function(bufnr)
vim.lsp.buf.format({ vim.lsp.buf.format({
filter = function (client) filter = function(client)
return client.name == "null-ls" return client.name == "null-ls"
end, end,
bufnr = bufnr, bufnr = bufnr,
timeout_ms = 2000, timeout_ms = 2000,
-- async = true, -- async = true,
}) })
end end
-- Use an on_attach function to only map the following keys -- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer -- after the language server attaches to the current buffer
local on_attach = function(client, bufnr) local on_attach = function(client, bufnr)
lsp_status.on_attach(client) lsp_status.on_attach(client)
-- Mappings. -- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions -- See `:help vim.lsp.*` for documentation on any of the below functions
local bufopts = { noremap = true, silent = true, buffer = bufnr } local bufopts = { noremap = true, silent = true, buffer = bufnr }
vim.keymap.set('n', 'gD', vim.lsp.buf.definition, bufopts) vim.keymap.set("n", "gD", vim.lsp.buf.definition, bufopts)
vim.keymap.set('n', 'gd', '<cmd>Trouble lsp_definitions<cr>', bufopts) vim.keymap.set("n", "gd", "<cmd>Trouble lsp_definitions<cr>", bufopts)
vim.keymap.set('n', 'gR', vim.lsp.buf.references, bufopts) vim.keymap.set("n", "gR", vim.lsp.buf.references, bufopts)
vim.keymap.set('n', 'gr', '<cmd>Trouble lsp_references<cr>', bufopts) vim.keymap.set("n", "gr", "<cmd>Trouble lsp_references<cr>", bufopts)
vim.keymap.set('n', 'gI', vim.lsp.buf.implementation, bufopts) vim.keymap.set("n", "gI", vim.lsp.buf.implementation, bufopts)
vim.keymap.set('n', 'gi', '<cmd>Trouble lsp_implementations<cr>', bufopts) vim.keymap.set("n", "gi", "<cmd>Trouble lsp_implementations<cr>", bufopts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts) vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, bufopts)
vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, bufopts) vim.keymap.set("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, bufopts)
vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, bufopts) vim.keymap.set("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, bufopts)
vim.keymap.set('n', '<leader>wl', function() vim.keymap.set("n", "<leader>wl", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders())) print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, bufopts) end, bufopts)
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts) vim.keymap.set("n", "<leader>D", vim.lsp.buf.type_definition, bufopts)
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, bufopts) vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, bufopts)
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, bufopts) vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, bufopts)
vim.keymap.set('n', '<leader>i', lsp_formatting, bufopts) vim.keymap.set("n", "<leader>i", lsp_formatting, bufopts)
end end
local lsp_flags = { local lsp_flags = {
-- This is the default in Nvim 0.7+ -- This is the default in Nvim 0.7+
debounce_text_changes = 150, 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{ -- Set up null_ls first
on_attach = on_attach, local null_ls = require("null-ls")
flags = lsp_flags, null_ls.setup({
capabilities = capabilities, 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 { require("lspconfig")["pyright"].setup({
on_attach = on_attach, on_attach = on_attach,
flags = lsp_flags, flags = lsp_flags,
capabilities = capabilities capabilities = capabilities,
} })
require('lspconfig')['sumneko_lua'].setup { require("lspconfig")["fortls"].setup({
settings = { on_attach = on_attach,
Lua = { flags = lsp_flags,
runtime = { capabilities = capabilities,
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 { require("lspconfig")["sumneko_lua"].setup({
on_attach = on_attach, settings = {
flags = lsp_flags, Lua = {
capabilities = capabilities, 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,
})

View file

@ -1,7 +1,7 @@
require('nightfox').setup { require("nightfox").setup({
options = { options = {
transparent = true, transparent = true,
}, },
} })
require('nightfox').compile() require("nightfox").compile()
vim.cmd("colorscheme nightfox") vim.cmd("colorscheme nightfox")

View file

@ -1,65 +1,65 @@
vim.g.loaded_netrw = 1 vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1 vim.g.loaded_netrwPlugin = 1
vim.opt.termguicolors = true vim.opt.termguicolors = true
require('nvim-tree').setup { require("nvim-tree").setup({
disable_netrw = true, disable_netrw = true,
hijack_netrw = true, hijack_netrw = true,
hijack_cursor = true, hijack_cursor = true,
sync_root_with_cwd = true, sync_root_with_cwd = true,
respect_buf_cwd = true, respect_buf_cwd = true,
update_focused_file = { update_focused_file = {
enable = true, enable = true,
update_root = true, update_root = true,
}, },
diagnostics = { diagnostics = {
enable = true, enable = true,
show_on_dirs = true, show_on_dirs = true,
show_on_open_dirs = false, show_on_open_dirs = false,
}, },
git = { git = {
enable = true, enable = true,
show_on_dirs = true, show_on_dirs = true,
show_on_open_dirs = false, show_on_open_dirs = false,
}, },
modified = { modified = {
enable = true, enable = true,
show_on_dirs = true, show_on_dirs = true,
show_on_open_dirs = false, show_on_open_dirs = false,
}, },
view = { view = {
centralize_selection = true, centralize_selection = true,
}, },
renderer = { renderer = {
add_trailing = true, add_trailing = true,
group_empty = true, group_empty = true,
full_name = true, full_name = true,
highlight_git = true, highlight_git = true,
highlight_modified = "all", highlight_modified = "all",
indent_markers = { indent_markers = {
enable = true, enable = true,
}, },
icons = { icons = {
show = { show = {
git = false, git = false,
modified = false, modified = false,
}, },
}, },
}, },
filters = { filters = {
dotfiles = true, dotfiles = true,
}, },
} })
local function open_nvim_tree(data) local function open_nvim_tree(data)
-- buffer is a [No Name] -- buffer is a [No Name]
local no_name = data.file == "" and vim.bo[data.buf].buftype == "" local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
if not no_name then if not no_name then
return return
end end
-- open the tree, find the file but don't focus it -- open the tree, find the file but don't focus it
require("nvim-tree.api").tree.toggle({ focus = false }) require("nvim-tree.api").tree.toggle({ focus = false })
end end
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })

View file

@ -1,40 +1,40 @@
require("project_nvim").setup { require("project_nvim").setup({
-- Manual mode doesn't automatically change your root directory, so you have -- Manual mode doesn't automatically change your root directory, so you have
-- the option to manually do so using `:ProjectRoot` command. -- the option to manually do so using `:ProjectRoot` command.
manual_mode = false, manual_mode = false,
-- Methods of detecting the root directory. **"lsp"** uses the native neovim -- Methods of detecting the root directory. **"lsp"** uses the native neovim
-- lsp, while **"pattern"** uses vim-rooter like glob pattern matching. Here -- 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 -- order matters: if one is not detected, the other is used as fallback. You
-- can also delete or rearangne the detection methods. -- can also delete or rearangne the detection methods.
detection_methods = { "pattern", "lsp" }, detection_methods = { "pattern", "lsp" },
-- All the patterns used to detect root dir, when **"pattern"** is in -- All the patterns used to detect root dir, when **"pattern"** is in
-- detection_methods -- detection_methods
patterns = { ".git", ".venv", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" }, patterns = { ".git", ".venv", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" },
-- Table of lsp clients to ignore by name -- Table of lsp clients to ignore by name
-- eg: { "efm", ... } -- eg: { "efm", ... }
ignore_lsp = {}, ignore_lsp = {},
-- Don't calculate root dir on specific directories -- Don't calculate root dir on specific directories
-- Ex: { "~/.cargo/*", ... } -- Ex: { "~/.cargo/*", ... }
exclude_dirs = {}, exclude_dirs = {},
-- Show hidden files in telescope -- Show hidden files in telescope
show_hidden = false, show_hidden = false,
-- When set to false, you will get a message when project.nvim changes your -- When set to false, you will get a message when project.nvim changes your
-- directory. -- directory.
silent_chdir = true, silent_chdir = true,
-- What scope to change the directory, valid options are -- What scope to change the directory, valid options are
-- * global (default) -- * global (default)
-- * tab -- * tab
-- * win -- * win
scope_chdir = 'global', scope_chdir = "global",
-- Path where project.nvim will store the project history for use in -- Path where project.nvim will store the project history for use in
-- telescope -- telescope
datapath = vim.fn.stdpath("data"), datapath = vim.fn.stdpath("data"),
} })

View file

@ -31,50 +31,50 @@ local fmt = string.format
---@param n number ---@param n number
---@return string ---@return string
local hex = function(n) local hex = function(n)
if n then if n then
return fmt("#%06x", n) return fmt("#%06x", n)
end end
end end
---Parse `style` string into nvim_set_hl options ---Parse `style` string into nvim_set_hl options
---@param style string ---@param style string
---@return table ---@return table
local function parse_style(style) local function parse_style(style)
if not style or style == "NONE" then if not style or style == "NONE" then
return {} return {}
end end
local result = {} local result = {}
for token in string.gmatch(style, "([^,]+)") do for token in string.gmatch(style, "([^,]+)") do
result[token] = true result[token] = true
end end
return result return result
end end
---Get highlight opts for a given highlight group name ---Get highlight opts for a given highlight group name
---@param name string ---@param name string
---@return table ---@return table
local function get_highlight(name) local function get_highlight(name)
local hl = vim.api.nvim_get_hl_by_name(name, true) local hl = vim.api.nvim_get_hl_by_name(name, true)
if hl.link then if hl.link then
return get_highlight(hl.link) return get_highlight(hl.link)
end end
local result = parse_style(hl.style) local result = parse_style(hl.style)
result.fg = hl.foreground and hex(hl.foreground) result.fg = hl.foreground and hex(hl.foreground)
result.bg = hl.background and hex(hl.background) result.bg = hl.background and hex(hl.background)
result.sp = hl.special and hex(hl.special) result.sp = hl.special and hex(hl.special)
return result return result
end end
---Set highlight group from provided table ---Set highlight group from provided table
---@param groups table ---@param groups table
local function set_highlights(groups) local function set_highlights(groups)
for group, opts in pairs(groups) do for group, opts in pairs(groups) do
vim.api.nvim_set_hl(0, group, opts) vim.api.nvim_set_hl(0, group, opts)
end end
end end
---Generate a color palette from the current applied colorscheme ---Generate a color palette from the current applied colorscheme
@ -92,18 +92,18 @@ local function generate_pallet_from_colorscheme()
white = { index = 7, default = "#dfdfe0" }, white = { index = 7, default = "#dfdfe0" },
} }
local pallet = {} local pallet = {}
for name, value in pairs(color_map) do for name, value in pairs(color_map) do
local global_name = "terminal_color_" .. value.index local global_name = "terminal_color_" .. value.index
pallet[name] = vim.g[global_name] and vim.g[global_name] or value.default pallet[name] = vim.g[global_name] and vim.g[global_name] or value.default
end end
pallet.sl = get_highlight("StatusLine") pallet.sl = get_highlight("StatusLine")
pallet.tab = get_highlight("TabLine") pallet.tab = get_highlight("TabLine")
pallet.sel = get_highlight("TabLineSel") pallet.sel = get_highlight("TabLineSel")
pallet.fill = get_highlight("TabLineFill") pallet.fill = get_highlight("TabLineFill")
return pallet return pallet
end end
---Generate user highlight groups based on the curent applied colorscheme ---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 ---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 ---and it is needed for the autocmd below
_G._genreate_user_tabline_highlights = function() _G._genreate_user_tabline_highlights = function()
local pal = generate_pallet_from_colorscheme() local pal = generate_pallet_from_colorscheme()
-- stylua: ignore -- stylua: ignore
local sl_colors = { local sl_colors = {
@ -125,32 +125,32 @@ _G._genreate_user_tabline_highlights = function()
White = { fg = pal.white, bg = pal.black }, White = { fg = pal.white, bg = pal.black },
} }
local colors = {} local colors = {}
for name, value in pairs(sl_colors) do for name, value in pairs(sl_colors) do
colors["User" .. name] = { fg = value.fg, bg = value.bg, bold = true } colors["User" .. name] = { fg = value.fg, bg = value.bg, bold = true }
colors["UserRv" .. name] = { fg = value.bg, bg = value.fg, bold = true } colors["UserRv" .. name] = { fg = value.bg, bg = value.fg, bold = true }
end end
local groups = { local groups = {
-- tabline -- tabline
UserTLHead = { fg = pal.fill.bg, bg = pal.cyan }, UserTLHead = { fg = pal.fill.bg, bg = pal.cyan },
UserTLHeadSep = { fg = pal.cyan, bg = pal.fill.bg }, UserTLHeadSep = { fg = pal.cyan, bg = pal.fill.bg },
UserTLActive = { fg = pal.sel.fg, bg = pal.sel.bg, bold = true }, UserTLActive = { fg = pal.sel.fg, bg = pal.sel.bg, bold = true },
UserTLActiveSep = { fg = pal.sel.bg, bg = pal.fill.bg }, UserTLActiveSep = { fg = pal.sel.bg, bg = pal.fill.bg },
UserTLBoldLine = { fg = pal.tab.fg, bg = pal.tab.bg, bold = true }, UserTLBoldLine = { fg = pal.tab.fg, bg = pal.tab.bg, bold = true },
UserTLLineSep = { fg = pal.tab.bg, bg = pal.fill.bg }, 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 end
_genreate_user_tabline_highlights() _genreate_user_tabline_highlights()
vim.api.nvim_create_augroup("UserTablineHighlightGroups", { clear = true }) vim.api.nvim_create_augroup("UserTablineHighlightGroups", { clear = true })
vim.api.nvim_create_autocmd({ "SessionLoadPost", "ColorScheme" }, { vim.api.nvim_create_autocmd({ "SessionLoadPost", "ColorScheme" }, {
callback = function() callback = function()
_genreate_user_tabline_highlights() _genreate_user_tabline_highlights()
end, end,
}) })
---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
@ -159,62 +159,62 @@ vim.api.nvim_create_autocmd({ "SessionLoadPost", "ColorScheme" }, {
local filename = require("tabby.module.filename") local filename = require("tabby.module.filename")
local cwd = function() local cwd = function()
return "" .. vim.fn.fnamemodify(vim.fn.getcwd(), ":t") .. " " return "" .. vim.fn.fnamemodify(vim.fn.getcwd(), ":t") .. " "
end end
local line = { local line = {
hl = "TabLineFill", hl = "TabLineFill",
layout = "active_wins_at_tail", layout = "active_wins_at_tail",
head = { head = {
{ cwd, hl = "UserTLHead" }, { cwd, hl = "UserTLHead" },
{ "", hl = "UserTLHeadSep" }, { "", hl = "UserTLHeadSep" },
}, },
active_tab = { active_tab = {
label = function(tabid) label = function(tabid)
return { return {
"" .. tabid .. " ", "" .. tabid .. " ",
hl = "UserTLActive", hl = "UserTLActive",
} }
end, end,
left_sep = { "", hl = "UserTLActiveSep" }, left_sep = { "", hl = "UserTLActiveSep" },
right_sep = { "", hl = "UserTLActiveSep" }, right_sep = { "", hl = "UserTLActiveSep" },
}, },
inactive_tab = { inactive_tab = {
label = function(tabid) label = function(tabid)
return { return {
"" .. tabid .. " ", "" .. tabid .. " ",
hl = "UserTLBoldLine", hl = "UserTLBoldLine",
} }
end, end,
left_sep = { "", hl = "UserTLLineSep" }, left_sep = { "", hl = "UserTLLineSep" },
right_sep = { "", hl = "UserTLLineSep" }, right_sep = { "", hl = "UserTLLineSep" },
}, },
top_win = { top_win = {
label = function(winid) label = function(winid)
return { return {
"" .. filename.unique(winid) .. " ", "" .. filename.unique(winid) .. " ",
hl = "TabLine", hl = "TabLine",
} }
end, end,
left_sep = { "", hl = "UserTLLineSep" }, left_sep = { "", hl = "UserTLLineSep" },
right_sep = { "", hl = "UserTLLineSep" }, right_sep = { "", hl = "UserTLLineSep" },
}, },
win = { win = {
label = function(winid) label = function(winid)
return { return {
"" .. filename.unique(winid) .. " ", "" .. filename.unique(winid) .. " ",
hl = "TabLine", hl = "TabLine",
} }
end, end,
left_sep = { "", hl = "UserTLLineSep" }, left_sep = { "", hl = "UserTLLineSep" },
right_sep = { "", hl = "UserTLLineSep" }, right_sep = { "", hl = "UserTLLineSep" },
}, },
tail = { tail = {
{ "", hl = "UserTLHeadSep" }, { "", hl = "UserTLHeadSep" },
{ "", hl = "UserTLHead" }, { "", hl = "UserTLHead" },
}, },
} }
require("tabby").setup({ require("tabby").setup({
tabline = line, tabline = line,
}) })

View file

@ -1,32 +1,32 @@
require('telescope.actions') require("telescope.actions")
local trouble = require('trouble.providers.telescope') local trouble = require("trouble.providers.telescope")
require('telescope').setup { require("telescope").setup({
extensions = { extensions = {
fzf = { fzf = {
fuzzy = true, -- false will only do exact matching fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter override_file_sorter = true, -- override the file sorter
case_mode = "smart_case", -- or "ignore_case" or "respect_case" case_mode = "smart_case", -- or "ignore_case" or "respect_case"
-- the default case_mode is "smart_case" -- the default case_mode is "smart_case"
}, },
aerial = { aerial = {
show_nesting = { show_nesting = {
["_"] = false, ["_"] = false,
python = true, python = true,
json = true, json = true,
yaml = true, yaml = true,
}, },
}, },
}, },
defaults = { defaults = {
mappings = { mappings = {
i = { ["<c-t>"] = trouble.open_with_trouble }, i = { ["<c-t>"] = trouble.open_with_trouble },
n = { ["<c-t>"] = trouble.open_with_trouble }, n = { ["<c-t>"] = trouble.open_with_trouble },
}, },
}, },
} })
require('telescope').load_extension('fzf') require("telescope").load_extension("fzf")
require('telescope').load_extension('notify') require("telescope").load_extension("notify")
require('telescope').load_extension('projects') require("telescope").load_extension("projects")

View file

@ -1,22 +1,22 @@
require('toggleterm').setup { require("toggleterm").setup({
direction = 'horizontal', direction = "horizontal",
open_mapping = [[\t]], open_mapping = [[\t]],
size = function (term) size = function(term)
if term.direction == "horizontal" then if term.direction == "horizontal" then
return 15 return 15
elseif term.direction == "vertical" then elseif term.direction == "vertical" then
return vim.o.columns * 0.3 return vim.o.columns * 0.3
end end
end, end,
hide_numbers = true, -- hide the number column in toggleterm buffers hide_numbers = true, -- hide the number column in toggleterm buffers
persist_size = false, persist_size = false,
float_opts = { float_opts = {
border = 'curved', border = "curved",
}, },
winbar = { winbar = {
enabled = false, enabled = false,
name_formatter = function(term) -- term: Terminal name_formatter = function(term) -- term: Terminal
return term.name return term.name
end end,
}, },
} })

View file

@ -1,7 +1,7 @@
require 'nvim-treesitter.configs'.setup { require("nvim-treesitter.configs").setup({
highlight = { highlight = {
enable = true, enable = true,
additional_vim_regex_highlighting = false, additional_vim_regex_highlighting = false,
disable = { 'help', 'fortran' }, disable = { "help", "fortran" },
}, },
} })

View file

@ -1,47 +1,47 @@
require('trouble').setup { require("trouble").setup({
position = "bottom", -- position of the list can be: bottom, top, left, right 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 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 width = 50, -- width of the list when position is left or right
icons = true, -- use devicons for filenames icons = true, -- use devicons for filenames
mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist" mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist"
fold_open = "", -- icon used for open folds fold_open = "", -- icon used for open folds
fold_closed = "", -- icon used for closed folds fold_closed = "", -- icon used for closed folds
group = true, -- group results by file group = true, -- group results by file
padding = true, -- add an extra new line on top of the list padding = true, -- add an extra new line on top of the list
action_keys = { -- key mappings for actions in the trouble list action_keys = { -- key mappings for actions in the trouble list
-- map to {} to remove a mapping, for example: -- map to {} to remove a mapping, for example:
-- close = {}, -- close = {},
close = "q", -- close the list close = "q", -- close the list
cancel = "<esc>", -- cancel the preview and get back to your last window / buffer / cursor cancel = "<esc>", -- cancel the preview and get back to your last window / buffer / cursor
refresh = "r", -- manually refresh refresh = "r", -- manually refresh
jump = { "<cr>", "<tab>" }, -- jump to the diagnostic or open / close folds jump = { "<cr>", "<tab>" }, -- jump to the diagnostic or open / close folds
open_split = { "<c-x>" }, -- open buffer in new split open_split = { "<c-x>" }, -- open buffer in new split
open_vsplit = { "<c-v>" }, -- open buffer in new vsplit open_vsplit = { "<c-v>" }, -- open buffer in new vsplit
open_tab = { "<c-t>" }, -- open buffer in new tab open_tab = { "<c-t>" }, -- open buffer in new tab
jump_close = { "o" }, -- jump to the diagnostic and close the list jump_close = { "o" }, -- jump to the diagnostic and close the list
toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode
toggle_preview = "P", -- toggle auto_preview toggle_preview = "P", -- toggle auto_preview
hover = "K", -- opens a small popup with the full multiline message hover = "K", -- opens a small popup with the full multiline message
preview = "p", -- preview the diagnostic location preview = "p", -- preview the diagnostic location
close_folds = { "zM", "zm" }, -- close all folds close_folds = { "zM", "zm" }, -- close all folds
open_folds = { "zR", "zr" }, -- open all folds open_folds = { "zR", "zr" }, -- open all folds
toggle_fold = { "zA", "za" }, -- toggle fold of current file toggle_fold = { "zA", "za" }, -- toggle fold of current file
previous = "k", -- previous item previous = "k", -- previous item
next = "j" -- next item next = "j", -- next item
}, },
indent_lines = true, -- add an indent guide below the fold icons indent_lines = true, -- add an indent guide below the fold icons
auto_open = false, -- automatically open the list when you have diagnostics auto_open = false, -- automatically open the list when you have diagnostics
auto_close = true, -- automatically close the list when you have no diagnostics auto_close = true, -- automatically close the list when you have no diagnostics
auto_preview = true, -- automatically preview the location of the diagnostic. <esc> to close preview and go back to last window auto_preview = true, -- automatically preview the location of the diagnostic. <esc> to close preview and go back to last window
auto_fold = false, -- automatically fold a file trouble list at creation 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 auto_jump = { "lsp_definitions" }, -- for the given modes, automatically jump if there is only a single result
signs = { signs = {
-- icons / text used for a diagnostic -- icons / text used for a diagnostic
error = "", error = "",
warning = "", warning = "",
hint = "", hint = "",
information = "", information = "",
other = "" other = "",
}, },
use_diagnostic_signs = false, -- enabling this will use the signs defined in your lsp client use_diagnostic_signs = false, -- enabling this will use the signs defined in your lsp client
} })

View file

@ -1,39 +1,39 @@
vim.g.mapleader = ' ' vim.g.mapleader = " "
vim.keymap.set('i', 'jk', '<esc>') vim.keymap.set("i", "jk", "<esc>")
-- Toggleterm -- Toggleterm
vim.keymap.set('n', '<leader>th', '<cmd>ToggleTerm direction=horizontal<cr>') vim.keymap.set("n", "<leader>th", "<cmd>ToggleTerm direction=horizontal<cr>")
vim.keymap.set('n', '<leader>tv', '<cmd>ToggleTerm direction=vertical<cr>') vim.keymap.set("n", "<leader>tv", "<cmd>ToggleTerm direction=vertical<cr>")
vim.keymap.set('n', '<leader>tf', '<cmd>ToggleTerm direction=float<cr>') vim.keymap.set("n", "<leader>tf", "<cmd>ToggleTerm direction=float<cr>")
vim.keymap.set('n', '<leader>tt', '<cmd>ToggleTerm direction=tab<cr>') vim.keymap.set("n", "<leader>tt", "<cmd>ToggleTerm direction=tab<cr>")
-- Aerial -- Aerial
vim.keymap.set('n', '<leader>aa', '<cmd>AerialToggle<cr>') vim.keymap.set("n", "<leader>aa", "<cmd>AerialToggle<cr>")
-- Telescope -- Telescope
vim.keymap.set('n', '<leader>;', '<cmd>Telescope builtin<cr>') vim.keymap.set("n", "<leader>;", "<cmd>Telescope builtin<cr>")
vim.keymap.set('n', '<leader>ff', '<cmd>Telescope find_files<cr>') vim.keymap.set("n", "<leader>ff", "<cmd>Telescope find_files<cr>")
vim.keymap.set('n', '<leader>fg', '<cmd>Telescope live_grep<cr>') vim.keymap.set("n", "<leader>fg", "<cmd>Telescope live_grep<cr>")
vim.keymap.set('n', '<leader>fp', '<cmd>Telescope projects<cr>') vim.keymap.set("n", "<leader>fp", "<cmd>Telescope projects<cr>")
vim.keymap.set('n', '<leader>fa', '<cmd>Telescope aerial<cr>') vim.keymap.set("n", "<leader>fa", "<cmd>Telescope aerial<cr>")
vim.keymap.set('n', '<leader>fl', '<cmd>Telescope lsp_document_symbols<cr>') vim.keymap.set("n", "<leader>fl", "<cmd>Telescope lsp_document_symbols<cr>")
vim.keymap.set('n', '<leader>fe', '<cmd>Telescope diagnostics<cr>') vim.keymap.set("n", "<leader>fe", "<cmd>Telescope diagnostics<cr>")
vim.keymap.set('n', '<leader>fs', '<cmd>Telescope treesitter<cr>') vim.keymap.set("n", "<leader>fs", "<cmd>Telescope treesitter<cr>")
vim.keymap.set('n', '<leader>fz', '<cmd>Telescope current_buffer_fuzzy_find<cr>') vim.keymap.set("n", "<leader>fz", "<cmd>Telescope current_buffer_fuzzy_find<cr>")
-- Nvim-tree -- Nvim-tree
vim.keymap.set('n', '<leader>n', '<cmd>NvimTreeToggle<cr>') vim.keymap.set("n", "<leader>n", "<cmd>NvimTreeToggle<cr>")
-- Trouble -- Trouble
vim.keymap.set('n', '<leader>xx', '<cmd>TroubleToggle<cr>') vim.keymap.set("n", "<leader>xx", "<cmd>TroubleToggle<cr>")
vim.keymap.set('n', '<leader>xw', '<cmd>TroubleToggle workspace_diagnostics<cr>') vim.keymap.set("n", "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>")
vim.keymap.set('n', '<leader>xd', '<cmd>TroubleToggle document_diagnostics<cr>') vim.keymap.set("n", "<leader>xd", "<cmd>TroubleToggle document_diagnostics<cr>")
vim.keymap.set('n', '<leader>xq', '<cmd>TroubleToggle quickfix<cr>') vim.keymap.set("n", "<leader>xq", "<cmd>TroubleToggle quickfix<cr>")
vim.keymap.set('n', '<leader>xl', '<cmd>TroubleToggle loclist<cr>') vim.keymap.set("n", "<leader>xl", "<cmd>TroubleToggle loclist<cr>")
-- Navigator -- Navigator
vim.keymap.set({'n', 't'}, '<A-h>', '<CMD>NavigatorLeft<CR>') vim.keymap.set({ "n", "t" }, "<A-h>", "<CMD>NavigatorLeft<CR>")
vim.keymap.set({'n', 't'}, '<A-l>', '<CMD>NavigatorRight<CR>') vim.keymap.set({ "n", "t" }, "<A-l>", "<CMD>NavigatorRight<CR>")
vim.keymap.set({'n', 't'}, '<A-k>', '<CMD>NavigatorUp<CR>') vim.keymap.set({ "n", "t" }, "<A-k>", "<CMD>NavigatorUp<CR>")
vim.keymap.set({'n', 't'}, '<A-j>', '<CMD>NavigatorDown<CR>') vim.keymap.set({ "n", "t" }, "<A-j>", "<CMD>NavigatorDown<CR>")
vim.keymap.set({'n', 't'}, '<A-p>', '<CMD>NavigatorPrevious<CR>') vim.keymap.set({ "n", "t" }, "<A-p>", "<CMD>NavigatorPrevious<CR>")

View file

@ -1,17 +1,17 @@
vim.opt.title = true vim.opt.title = true
vim.g.python3_host_prog = '/usr/bin/python3' vim.g.python3_host_prog = "/usr/bin/python3"
vim.g.python_indent = { vim.g.python_indent = {
open_paren = 'shiftwidth()', open_paren = "shiftwidth()",
nested_paren = 'shiftwidth()', nested_paren = "shiftwidth()",
continue = 'shiftwidth()', continue = "shiftwidth()",
closed_paren_align_last_line = 'v:false', closed_paren_align_last_line = "v:false",
} }
vim.opt.termguicolors = true vim.opt.termguicolors = true
vim.opt.mouse = "nv" vim.opt.mouse = "nv"
vim.opt.shiftwidth = 4 vim.opt.shiftwidth = 4
vim.opt.number = true vim.opt.number = true
vim.opt.relativenumber = true vim.opt.relativenumber = true
vim.opt.listchars = { trail = '.', tab = '>_' } vim.opt.listchars = { trail = ".", tab = ">_" }
vim.opt.list = true vim.opt.list = true
vim.opt.wrap = true vim.opt.wrap = true
vim.opt.linebreak = true vim.opt.linebreak = true

View file

@ -5,153 +5,153 @@ vim.cmd([[
augroup end augroup end
]]) ]])
require('packer').startup { require("packer").startup({
function(use) function(use)
use 'wbthomason/packer.nvim' use("wbthomason/packer.nvim")
use 'lewis6991/impatient.nvim' use("lewis6991/impatient.nvim")
use 'stevearc/dressing.nvim' use("stevearc/dressing.nvim")
use { use({
"EdenEast/nightfox.nvim", "EdenEast/nightfox.nvim",
config = function () config = function()
require 'config.nightfox' require("config.nightfox")
end end,
} })
use { use({
'nanozuki/tabby.nvim', "nanozuki/tabby.nvim",
config = function () config = function()
require 'config.tabby' require("config.tabby")
end end,
} })
use { use({
'rcarriga/nvim-notify', "rcarriga/nvim-notify",
config = function() config = function()
require("notify").setup { require("notify").setup({
background_colour = "#282c34", background_colour = "#282c34",
} })
vim.notify = require("notify") vim.notify = require("notify")
end end,
} })
use { use({
'vigoux/notifier.nvim', "vigoux/notifier.nvim",
config = function () config = function()
require('notifier') require("notifier")
end end,
} })
use 'kyazdani42/nvim-web-devicons' use("kyazdani42/nvim-web-devicons")
use 'nvim-lua/plenary.nvim' use("nvim-lua/plenary.nvim")
use { use({
'neovim/nvim-lspconfig', "neovim/nvim-lspconfig",
'https://github.com/nvim-lua/lsp-status.nvim.git', "https://github.com/nvim-lua/lsp-status.nvim.git",
'hrsh7th/nvim-cmp', "hrsh7th/nvim-cmp",
'hrsh7th/cmp-nvim-lsp', "hrsh7th/cmp-nvim-lsp",
'hrsh7th/cmp-buffer', "hrsh7th/cmp-buffer",
'hrsh7th/cmp-path', "hrsh7th/cmp-path",
'hrsh7th/cmp-cmdline', "hrsh7th/cmp-cmdline",
'f3fora/cmp-spell', "f3fora/cmp-spell",
'petertriho/cmp-git', "petertriho/cmp-git",
'Dosx001/cmp-commit', "Dosx001/cmp-commit",
'kdheepak/cmp-latex-symbols', "kdheepak/cmp-latex-symbols",
'L3MON4D3/LuaSnip', "L3MON4D3/LuaSnip",
'saadparwaiz1/cmp_luasnip', "saadparwaiz1/cmp_luasnip",
'rafamadriz/friendly-snippets', "rafamadriz/friendly-snippets",
'windwp/nvim-autopairs', "windwp/nvim-autopairs",
'https://github.com/jose-elias-alvarez/null-ls.nvim', "https://github.com/jose-elias-alvarez/null-ls.nvim",
} })
use { use({
'nvim-treesitter/nvim-treesitter', "nvim-treesitter/nvim-treesitter",
config = function() config = function()
require 'config.treesitter' require("config.treesitter")
end end,
} })
use { use({
"ThePrimeagen/refactoring.nvim", "ThePrimeagen/refactoring.nvim",
requires = { requires = {
{"nvim-lua/plenary.nvim"}, { "nvim-lua/plenary.nvim" },
{"nvim-treesitter/nvim-treesitter"} { "nvim-treesitter/nvim-treesitter" },
}, },
config = function () config = function()
require("refactoring").setup() require("refactoring").setup()
end end,
} })
use { use({
'tpope/vim-fugitive', "tpope/vim-fugitive",
} })
use { use({
'https://github.com/lewis6991/gitsigns.nvim.git', "https://github.com/lewis6991/gitsigns.nvim.git",
config = function() config = function()
require 'config.gitsigns' require("config.gitsigns")
end end,
} })
use { use({
'feline-nvim/feline.nvim', "feline-nvim/feline.nvim",
config = function () config = function()
require 'config.feline' require("config.feline")
end end,
} })
use { use({
'kyazdani42/nvim-tree.lua', "kyazdani42/nvim-tree.lua",
config = function() config = function()
require 'config.nvim-tree' require("config.nvim-tree")
end end,
} })
use { use({
"ahmedkhalf/project.nvim", "ahmedkhalf/project.nvim",
config = function() config = function()
require 'config.project' require("config.project")
end end,
} })
use { use({
'akinsho/toggleterm.nvim', "akinsho/toggleterm.nvim",
tag = 'v2.*', tag = "v2.*",
config = function() config = function()
require 'config.toggleterm' require("config.toggleterm")
end end,
} })
use { use({
'nvim-telescope/telescope-fzf-native.nvim', "nvim-telescope/telescope-fzf-native.nvim",
run = 'make' run = "make",
} })
use { use({
'nvim-telescope/telescope.nvim', "nvim-telescope/telescope.nvim",
branch = '0.1.x', branch = "0.1.x",
requires = { requires = {
{ 'nvim-lua/plenary.nvim' } { "nvim-lua/plenary.nvim" },
}, },
config = function() config = function()
require 'config.telescope' require("config.telescope")
end end,
} })
use { use({
'folke/trouble.nvim', "folke/trouble.nvim",
config = function() config = function()
require 'config.trouble' require("config.trouble")
end end,
} })
use { use({
"lukas-reineke/indent-blankline.nvim", "lukas-reineke/indent-blankline.nvim",
config = function() config = function()
require('indent_blankline').setup { require("indent_blankline").setup({
show_current_context = true, show_current_context = true,
show_current_context_start = false, show_current_context_start = false,
} })
end end,
} })
use { use({
'numToStr/Navigator.nvim', "numToStr/Navigator.nvim",
config = function() config = function()
require('Navigator').setup { require("Navigator").setup({
mux = 'auto' mux = "auto",
} })
end end,
} })
end, end,
config = { config = {
display = { display = {
open_fn = function() open_fn = function()
return require('packer.util').float({ border = 'single' }) return require("packer.util").float({ border = "single" })
end end,
}, },
} },
} })
require 'config.lsp' require("config.lsp")
require 'config.cmp' require("config.cmp")

View file

@ -1,6 +1,6 @@
-- TODO convert to lua -- TODO convert to lua
vim.cmd("let &t_ut=''") -- For kitty background colour support vim.cmd("let &t_ut=''") -- For kitty background colour support
vim.cmd [[ vim.cmd([[
au BufRead,BufNewFile *.ipynb setlocal filetype=json au BufRead,BufNewFile *.ipynb setlocal filetype=json
au BufRead,BufNewFile *.md setlocal spell au BufRead,BufNewFile *.md setlocal spell
au BufRead,BufNewFile *.code-workspace setlocal filetype=json 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 BufRead,BufNewFile *.service[a-zA-Z0-9]* setlocal filetype=systemd
au TermOpen * setlocal nonumber norelativenumber au TermOpen * setlocal nonumber norelativenumber
syntax on syntax on
]] ]])

View file

@ -2,7 +2,7 @@ fzf
lazygit lazygit
lua-language-server lua-language-server
neovim neovim
pyenv prettier
python python
python-black python-black
python-isort python-isort
@ -13,6 +13,8 @@ python-pre-commit
python-pynvim python-pynvim
python-virtualenv python-virtualenv
ripgrep ripgrep
shfmt
stylua
tmux tmux
tree-sitter tree-sitter
wezterm wezterm