nvim: add separate config files for most plugins
This commit is contained in:
parent
9db80c9673
commit
04dacde028
25 changed files with 294 additions and 291 deletions
7
modules/programs/nvim/plugins/catppuccin-nvim.lua
Normal file
7
modules/programs/nvim/plugins/catppuccin-nvim.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
require("catppuccin").setup({
|
||||
compile_path = vim.fn.stdpath("cache") .. "/catppuccin", -- fix issue of writing to nix store
|
||||
integrations = {
|
||||
which_key = true,
|
||||
},
|
||||
})
|
||||
vim.cmd.colorscheme("catppuccin-macchiato")
|
||||
1
modules/programs/nvim/plugins/comment-nvim.lua
Normal file
1
modules/programs/nvim/plugins/comment-nvim.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
require("Comment").setup()
|
||||
8
modules/programs/nvim/plugins/copilot-lua.lua
Normal file
8
modules/programs/nvim/plugins/copilot-lua.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
require("copilot").setup({
|
||||
suggestion = { enabled = false },
|
||||
panel = { enabled = false },
|
||||
})
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
desc = "Disable Copilot by default on startup",
|
||||
command = "Copilot disable",
|
||||
})
|
||||
9
modules/programs/nvim/plugins/dashboard-nvim.lua
Normal file
9
modules/programs/nvim/plugins/dashboard-nvim.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
require("dashboard").setup({
|
||||
theme = "hyper",
|
||||
config = {
|
||||
packages = { enable = false },
|
||||
week_header = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
71
modules/programs/nvim/plugins/formatter-nvim.lua
Normal file
71
modules/programs/nvim/plugins/formatter-nvim.lua
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
-- Provides the Format, FormatWrite, FormatLock, and FormatWriteLock commands
|
||||
require("formatter").setup({
|
||||
-- Enable or disable logging
|
||||
logging = true,
|
||||
-- Set the log level
|
||||
log_level = vim.log.levels.WARN,
|
||||
-- All formatter configurations are opt-in
|
||||
filetype = {
|
||||
json = {
|
||||
require("formatter.filetypes.json").jq,
|
||||
},
|
||||
lua = {
|
||||
require("formatter.filetypes.lua").stylua,
|
||||
},
|
||||
nix = {
|
||||
require("formatter.filetypes.nix").nixpkgs_fmt,
|
||||
},
|
||||
python = {
|
||||
require("formatter.filetypes.python").black,
|
||||
},
|
||||
rust = {
|
||||
require("formatter.filetypes.rust").rustfmt,
|
||||
},
|
||||
sh = {
|
||||
require("formatter.filetypes.sh").shfmt,
|
||||
},
|
||||
toml = {
|
||||
require("formatter.filetypes.toml").taplo,
|
||||
},
|
||||
yaml = {
|
||||
require("formatter.filetypes.yaml").yamlfmt,
|
||||
},
|
||||
|
||||
-- HACK to use specific formatters only when specified
|
||||
alejandra = {
|
||||
require("formatter.filetypes.nix").alejandra,
|
||||
},
|
||||
isort = {
|
||||
require("formatter.filetypes.python").isort,
|
||||
},
|
||||
|
||||
-- Use the special "*" filetype for defining formatter configurations on
|
||||
-- any filetype
|
||||
["*"] = {
|
||||
-- "formatter.filetypes.any" defines default configurations for any
|
||||
-- filetype
|
||||
require("formatter.filetypes.any").remove_trailing_whitespace,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command("Fmt", function(opts)
|
||||
local params = vim.split(opts.args, "%s+", { trimempty = true })
|
||||
local filetype = vim.bo.filetype
|
||||
vim.cmd("set filetype=" .. params[1]) -- fake filetype
|
||||
vim.cmd(":Format")
|
||||
vim.cmd("set filetype=" .. filetype) -- restore original filetype
|
||||
end, {
|
||||
nargs = 1,
|
||||
complete = function()
|
||||
local languages = {
|
||||
nix = { "alejandra" },
|
||||
python = { "isort" },
|
||||
}
|
||||
return languages[vim.bo.filetype] or {}
|
||||
end,
|
||||
})
|
||||
|
||||
require("which-key").register({
|
||||
["="] = { "<cmd>Format<cr>", "format (formatter)" },
|
||||
}, { noremap = true, silent = true })
|
||||
1
modules/programs/nvim/plugins/gitsigns-nvim.lua
Normal file
1
modules/programs/nvim/plugins/gitsigns-nvim.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
require("gitsigns").setup()
|
||||
44
modules/programs/nvim/plugins/lualine-nvim.lua
Normal file
44
modules/programs/nvim/plugins/lualine-nvim.lua
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
require("lualine").setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "auto",
|
||||
component_separators = "|",
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
},
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {
|
||||
{ "mode", separator = { left = "" }, right_padding = 2 },
|
||||
},
|
||||
lualine_b = { "branch", "diff", "diagnostics" },
|
||||
lualine_c = { "filename", "lsp_progress" },
|
||||
lualine_x = { "encoding", "fileformat", "filetype" },
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = {
|
||||
{ "location", separator = { right = "" }, left_padding = 2 },
|
||||
},
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {},
|
||||
})
|
||||
21
modules/programs/nvim/plugins/noice-nvim.lua
Normal file
21
modules/programs/nvim/plugins/noice-nvim.lua
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
require("noice").setup({
|
||||
lsp = {
|
||||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
},
|
||||
progress = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
-- you can enable a preset for easier configuration
|
||||
presets = {
|
||||
bottom_search = true, -- use a classic bottom cmdline for search
|
||||
command_palette = true, -- position the cmdline and popupmenu together
|
||||
long_message_to_split = true, -- long messages will be sent to a split
|
||||
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||
lsp_doc_border = false, -- add a border to hover docs and signature help
|
||||
},
|
||||
})
|
||||
1
modules/programs/nvim/plugins/nvim-autopairs.lua
Normal file
1
modules/programs/nvim/plugins/nvim-autopairs.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
require("nvim-autopairs").setup()
|
||||
5
modules/programs/nvim/plugins/nvim-lastplace.lua
Normal file
5
modules/programs/nvim/plugins/nvim-lastplace.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
require("nvim-lastplace").setup({
|
||||
lastplace_ignore_buftype = { "quickfix", "nofile", "help" },
|
||||
lastplace_ignore_filetype = { "gitcommit", "gitrebase", "svn", "hgcommit" },
|
||||
lastplace_open_folds = true,
|
||||
})
|
||||
1
modules/programs/nvim/plugins/nvim-surround.lua
Normal file
1
modules/programs/nvim/plugins/nvim-surround.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
require("nvim-surround").setup({})
|
||||
10
modules/programs/nvim/plugins/nvim-tree-lua.lua
Normal file
10
modules/programs/nvim/plugins/nvim-tree-lua.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
-- disable netrw at the very start of your init.lua (strongly advised)
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
-- set termguicolors to enable highlight groups
|
||||
vim.opt.termguicolors = true
|
||||
-- empty setup using defaults
|
||||
require("nvim-tree").setup()
|
||||
require("which-key").register({
|
||||
t = { "<cmd>NvimTreeFindFileToggle<cr>", "nvim tree" },
|
||||
}, { prefix = "<leader>t", silent = true })
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
require("nvim-treesitter.configs").setup({
|
||||
textsubjects = {
|
||||
enable = true,
|
||||
prev_selection = ",", -- (Optional) keymap to select the previous selection
|
||||
keymaps = { ["."] = "textsubjects-smart" },
|
||||
},
|
||||
})
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
require("nvim-treesitter.configs").setup({
|
||||
context_commentstring = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
||||
18
modules/programs/nvim/plugins/orgmode.lua
Normal file
18
modules/programs/nvim/plugins/orgmode.lua
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
local orgmode = require("orgmode")
|
||||
-- Load custom treesitter grammar for org filetype
|
||||
orgmode.setup_ts_grammar()
|
||||
-- Treesitter configuration
|
||||
require("nvim-treesitter.configs").setup({
|
||||
-- If TS highlights are not enabled at all, or disabled via `disable` prop,
|
||||
-- highlighting will fallback to default Vim syntax highlighting
|
||||
highlight = {
|
||||
enable = true,
|
||||
-- Required for spellcheck, some LaTex highlights and
|
||||
-- code block highlights that do not have ts grammar
|
||||
additional_vim_regex_highlighting = { "org" },
|
||||
},
|
||||
})
|
||||
orgmode.setup({
|
||||
org_agenda_files = { "~/Notes/org" },
|
||||
org_default_notes_file = "~/Notes/org/refile.org",
|
||||
})
|
||||
4
modules/programs/nvim/plugins/smartcolumn-nvim.lua
Normal file
4
modules/programs/nvim/plugins/smartcolumn-nvim.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
require("smartcolumn").setup({
|
||||
colorcolumn = 120,
|
||||
disabled_filetypes = { "help", "text", "markdown", "dashboard" },
|
||||
})
|
||||
|
|
@ -0,0 +1 @@
|
|||
require("telescope").load_extension("fzf")
|
||||
9
modules/programs/nvim/plugins/telescope-nvim.lua
Normal file
9
modules/programs/nvim/plugins/telescope-nvim.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
require("which-key").register({
|
||||
f = {
|
||||
name = "find",
|
||||
f = { "<cmd>Telescope find_files<cr>", "find file" },
|
||||
l = { "<cmd>Telescope current_buffer_fuzzy_find<cr>", "find line" },
|
||||
g = { "<cmd>Telescope live_grep<cr>", "live grep" },
|
||||
b = { "<cmd>Telescope buffers<cr>", "find buffer" },
|
||||
},
|
||||
}, { prefix = "<leader>" })
|
||||
7
modules/programs/nvim/plugins/telescope-zoxide.lua
Normal file
7
modules/programs/nvim/plugins/telescope-zoxide.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
require("telescope").load_extension("zoxide")
|
||||
require("which-key").register({
|
||||
f = {
|
||||
name = "find",
|
||||
z = { "<cmd>Telescope zoxide list<cr>", "find location" },
|
||||
},
|
||||
}, { prefix = "<leader>" })
|
||||
1
modules/programs/nvim/plugins/todo-comments-nvim.lua
Normal file
1
modules/programs/nvim/plugins/todo-comments-nvim.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
require("todo-comments").setup({})
|
||||
2
modules/programs/nvim/plugins/which-key-nvim.lua
Normal file
2
modules/programs/nvim/plugins/which-key-nvim.lua
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 500
|
||||
Loading…
Add table
Add a link
Reference in a new issue