summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatasha Moongrave <natasha@256phi.eu>2026-03-17 18:20:14 +0100
committerNatasha Moongrave <natasha@256phi.eu>2026-03-17 18:20:14 +0100
commit09d84c0a433b8a3769dbf8599bb839646c9743aa (patch)
treeaa15841aecb3987ae11c2802e0f1383e693930bf
parent0440d054e2360786c3589e6765ab8d901f0b1042 (diff)
Fixed neovim config in nord-blue rice
-rw-r--r--modules/home/i3wm/nord-blue/nvim.nix424
1 files changed, 215 insertions, 209 deletions
diff --git a/modules/home/i3wm/nord-blue/nvim.nix b/modules/home/i3wm/nord-blue/nvim.nix
index 5d0270c..ef054a0 100644
--- a/modules/home/i3wm/nord-blue/nvim.nix
+++ b/modules/home/i3wm/nord-blue/nvim.nix
@@ -94,215 +94,221 @@
# Lua Configuration
#################################################
extraLuaConfig = ''
- -------------------------------------------------
- -- LEADER
- -------------------------------------------------
- vim.g.mapleader = " "
-
- -------------------------------------------------
- -- BASIC OPTIONS
- -------------------------------------------------
- vim.opt.number = true
- vim.opt.relativenumber = true
- vim.opt.clipboard = "unnamedplus"
- vim.opt.showtabline = 2
- vim.o.timeout = true
- vim.o.timeoutlen = 300
-
- -------------------------------------------------
- -- THEME
- -------------------------------------------------
- require("catppuccin").setup({
- flavour = "mocha",
- })
- vim.cmd.colorscheme("catppuccin")
-
- -------------------------------------------------
- -- GITSIGNS
- -------------------------------------------------
- require("gitsigns").setup()
-
- -------------------------------------------------
- -- TREESITTER
- -------------------------------------------------
- require("nvim-treesitter.configs").setup({
- highlight = { enable = true },
- indent = { enable = true },
- })
-
- vim.opt.foldmethod = "expr"
- vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
- vim.opt.foldenable = false
-
- -------------------------------------------------
- -- SNIPPETS
- -------------------------------------------------
- require("luasnip.loaders.from_vscode").lazy_load()
-
- -------------------------------------------------
- -- COMPLETION
- -------------------------------------------------
- local cmp = require("cmp")
- local luasnip = require("luasnip")
-
- cmp.setup({
- snippet = {
- expand = function(args)
- luasnip.lsp_expand(args.body)
- end,
- },
-
- mapping = cmp.mapping.preset.insert({
- ["<C-Space>"] = cmp.mapping.complete(),
- ["<CR>"] = cmp.mapping.confirm({ select = true }),
- }),
-
- sources = {
- { name = "nvim_lsp" },
- { name = "luasnip" },
- },
- })
-
-
- -- BRACKET PAIRS
- require("nvim-autopairs").setup({})
-
- -------------------------------------------------
- -- LSP
- -------------------------------------------------
- local capabilities =
- require("cmp_nvim_lsp").default_capabilities()
-
- local servers = {
- "lua_ls",
- "nil_ls",
- "rust_analyzer",
- "pyright",
- "bashls",
- "texlab",
- }
-
- for _, server in ipairs(servers) do
- vim.lsp.config(server, {
- capabilities = capabilities
- })
- vim.lsp.enable(server)
- end
-
- -------------------------------------------------
- -- LSP KEYMAPS
- -------------------------------------------------
-
- -- navigation
- vim.keymap.set("n", "<leader>ld", vim.lsp.buf.definition)
- vim.keymap.set("n", "<leader>lD", vim.lsp.buf.declaration)
- vim.keymap.set("n", "<leader>li", vim.lsp.buf.implementation)
- vim.keymap.set("n", "<leader>lr", vim.lsp.buf.references)
-
- -- information
- vim.keymap.set("n", "lh", vim.lsp.buf.hover)
-
- -- refactor
- vim.keymap.set("n", "ln", vim.lsp.buf.rename)
- vim.keymap.set("n", "la", vim.lsp.buf.code_action)
-
- -- formatting
- vim.keymap.set("n", "lf", function()
- vim.lsp.buf.format()
- end)
-
- -------------------------------------------------
- -- DIAGNOSTICS
- -------------------------------------------------
-
- vim.keymap.set("n", "lj", vim.diagnostic.goto_next)
- vim.keymap.set("n", "lk", vim.diagnostic.goto_prev)
- vim.keymap.set("n", "le", vim.diagnostic.open_float)
-
- -------------------------------------------------
- -- FORMATTER
- -------------------------------------------------
-
- require("conform").setup({
- format_on_save = {
- timeout_ms = 500,
- lsp_format = "fallback",
- },
-
- formatters_by_ft = {
- lua = { "stylua" },
- nix = { "alejandra" },
- rust = { "rustfmt" },
- python = { "black" },
- bash = { "shfmt" },
- },
- })
-
- -- COMMENT TOGGLING
- require("Comment").setup()
-
- -------------------------------------------------
- -- TELESCOPE
- -------------------------------------------------
- local builtin = require("telescope.builtin")
-
- require("telescope").setup({
- defaults = {
- layout_strategy = "horizontal",
- sorting_strategy = "ascending",
- file_ignore_patterns = { "node_modules", ".git/" },
- },
- })
-
- vim.keymap.set("n", "<leader><leader>", builtin.find_files)
- vim.keymap.set("n", "<leader>fg", builtin.live_grep)
- vim.keymap.set("n", "<leader>fb", builtin.buffers)
-
- -------------------------------------------------
- -- WHICH KEY
- -------------------------------------------------
- local wk = require("which-key")
- wk.add({
- { "<leader>l", desc = "LSP"}
- })
-
- -------------------------------------------------
- -- NVIM TREE
- -------------------------------------------------
- require("nvim-tree").setup({})
- vim.keymap.set("n", "<leader>e", "<cmd>NvimTreeToggle<CR>")
-
- -------------------------------------------------
- -- TERMINAL
- -------------------------------------------------
- require("toggleterm").setup({
- direction = "float",
- })
-
- local Terminal = require("toggleterm.terminal").Terminal
-
- local lazygit = Terminal:new({
- cmd = "lazygit",
- hidden = true,
- direction = "float",
- })
-
- vim.keymap.set("n", "<leader>gg", function()
- lazygit:toggle()
- end)
-
- -------------------------------------------------
- -- ORGMODE
- -------------------------------------------------
- require("orgmode").setup({
- org_agenda_files = "~/**/*.org",
- org_default_notes_file = "~/INBOX.org"
- })
-
- -------------------------------------------------
- -- VIMTEX
- -------------------------------------------------
- vim.g.vimtex_view_method = "zathura"
+ -------------------------------------------------
+ -- LEADER
+ -------------------------------------------------
+ vim.g.mapleader = " "
+
+ -------------------------------------------------
+ -- BASIC OPTIONS
+ -------------------------------------------------
+ vim.opt.number = true
+ vim.opt.relativenumber = true
+ vim.opt.clipboard = "unnamedplus"
+ vim.opt.showtabline = 2
+ vim.o.timeout = true
+ vim.o.timeoutlen = 300
+
+ -------------------------------------------------
+ -- THEME
+ -------------------------------------------------
+ require("catppuccin").setup({
+ flavour = "mocha",
+ })
+ vim.cmd.colorscheme("catppuccin")
+
+ -------------------------------------------------
+ -- GITSIGNS
+ -------------------------------------------------
+ require("gitsigns").setup()
+
+ -------------------------------------------------
+ -- TREESITTER
+ -------------------------------------------------
+ require("nvim-treesitter.configs").setup({
+ highlight = { enable = true },
+ indent = { enable = true },
+ })
+
+ vim.opt.foldmethod = "expr"
+ vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
+ vim.opt.foldenable = false
+
+ -------------------------------------------------
+ -- SNIPPETS
+ -------------------------------------------------
+ require("luasnip.loaders.from_vscode").lazy_load()
+
+ -------------------------------------------------
+ -- COMPLETION
+ -------------------------------------------------
+ local cmp = require("cmp")
+ local luasnip = require("luasnip")
+
+ cmp.setup({
+ snippet = {
+ expand = function(args)
+ luasnip.lsp_expand(args.body)
+ end,
+ },
+
+ mapping = cmp.mapping.preset.insert({
+ ["<C-Space>"] = cmp.mapping.complete(),
+ ["<CR>"] = cmp.mapping.confirm({ select = true }),
+ }),
+
+ sources = {
+ { name = "nvim_lsp" },
+ { name = "luasnip" },
+ },
+ })
+
+
+ -- BRACKET PAIRS
+ require("nvim-autopairs").setup({})
+
+ -------------------------------------------------
+ -- LSP
+ -------------------------------------------------
+ local capabilities =
+ require("cmp_nvim_lsp").default_capabilities()
+
+ local servers = {
+ "lua_ls",
+ "nil_ls",
+ "rust_analyzer",
+ "pyright",
+ "bashls",
+ "texlab",
+ }
+
+ for _, server in ipairs(servers) do
+ vim.lsp.config(server, {
+ capabilities = capabilities
+ })
+ vim.lsp.enable(server)
+ end
+
+ -------------------------------------------------
+ -- LSP KEYMAPS
+ -------------------------------------------------
+
+ -- navigation
+ vim.keymap.set("n", "<leader>ld", vim.lsp.buf.definition)
+ vim.keymap.set("n", "<leader>lD", vim.lsp.buf.declaration)
+ vim.keymap.set("n", "<leader>li", vim.lsp.buf.implementation)
+ vim.keymap.set("n", "<leader>lr", vim.lsp.buf.references)
+
+ -- information
+ vim.keymap.set("n", "lh", vim.lsp.buf.hover)
+
+ -- refactor
+ vim.keymap.set("n", "ln", vim.lsp.buf.rename)
+ vim.keymap.set("n", "la", vim.lsp.buf.code_action)
+
+ -- formatting
+ vim.keymap.set("n", "lf", function()
+ vim.lsp.buf.format()
+ end)
+
+ -------------------------------------------------
+ -- DIAGNOSTICS
+ -------------------------------------------------
+
+ vim.keymap.set("n", "lj", vim.diagnostic.goto_next)
+ vim.keymap.set("n", "lk", vim.diagnostic.goto_prev)
+ vim.keymap.set("n", "le", vim.diagnostic.open_float)
+
+ -------------------------------------------------
+ -- FORMATTER
+ -------------------------------------------------
+
+ require("conform").setup({
+ format_on_save = {
+ timeout_ms = 500,
+ lsp_format = "fallback",
+ },
+
+ formatters_by_ft = {
+ lua = { "stylua" },
+ nix = { "alejandra" },
+ rust = { "rustfmt" },
+ python = { "black" },
+ bash = { "shfmt" },
+ },
+ })
+
+ -- COMMENT TOGGLING
+ require("Comment").setup()
+
+ -------------------------------------------------
+ -- TELESCOPE
+ -------------------------------------------------
+ local builtin = require("telescope.builtin")
+
+ require("telescope").setup({
+ defaults = {
+ layout_strategy = "horizontal",
+ sorting_strategy = "ascending",
+ file_ignore_patterns = { "node_modules", ".git/" },
+ },
+ })
+
+ vim.keymap.set("n", "<leader><leader>", builtin.find_files)
+ vim.keymap.set("n", "<leader>fg", builtin.live_grep)
+ vim.keymap.set("n", "<leader>fb", builtin.buffers)
+
+ -------------------------------------------------
+ -- WHICH KEY
+ -------------------------------------------------
+ local wk = require("which-key")
+ wk.add({
+ { "<leader>l", desc = "LSP"}
+ })
+
+ -------------------------------------------------
+ -- NVIM TREE
+ -------------------------------------------------
+ require("nvim-tree").setup({})
+ vim.keymap.set("n", "<leader>e", "<cmd>NvimTreeToggle<CR>")
+
+ -------------------------------------------------
+ -- TERMINAL
+ -------------------------------------------------
+ require("toggleterm").setup({
+ direction = "float",
+ })
+
+ local Terminal = require("toggleterm.terminal").Terminal
+
+ local lazygit = Terminal:new({
+ cmd = "lazygit",
+ hidden = true,
+ direction = "float",
+ })
+
+ vim.keymap.set("n", "<leader>gg", function()
+ lazygit:toggle()
+ end)
+
+ -------------------------------------------------
+ -- ORGMODE
+ -------------------------------------------------
+ local projects = {
+ "~/Documents/2_Writing/0_SOČ/**/*.org",
+ "~/Documents/2_Writing/2_Notes/**/*.org",
+ "~/Documents/1_Projects/6_CRC-Altura/**/*.org",
+ "~/ORG/**/*.org"
+ }
+ require("orgmode").setup({
+ org_agenda_files = projects,
+ org_default_notes_file = "~/INBOX.org"
+ })
+
+ -------------------------------------------------
+ -- VIMTEX
+ -------------------------------------------------
+ vim.g.vimtex_view_method = "zathura"
'';
};
}