summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatasha Moongrave <natasha@256phi.eu>2026-03-04 17:48:24 +0100
committerNatasha Moongrave <natasha@256phi.eu>2026-03-04 17:48:24 +0100
commit3d8f48467174748cd415fb0ad970b3b3ad0422b3 (patch)
tree5453ca1e0baa98a8d258502841ff2556a9f95b5f
parentd42562071986b3f0f9a48f63db9a0fd3ee0c8b8e (diff)
fixed syntax error and formatting in nvim.tex
-rw-r--r--modules/home/i3wm/nord-blue/nvim.nix401
1 files changed, 182 insertions, 219 deletions
diff --git a/modules/home/i3wm/nord-blue/nvim.nix b/modules/home/i3wm/nord-blue/nvim.nix
index 68ef37c..380e584 100644
--- a/modules/home/i3wm/nord-blue/nvim.nix
+++ b/modules/home/i3wm/nord-blue/nvim.nix
@@ -1,221 +1,184 @@
-{ pkgs, config, lib, ... }:
-
-{
- home.packages = with pkgs; [
- zathura
- ripgrep
- fd
- ];
-
- programs.neovim = {
- enable = true;
- defaultEditor = true;
- viAlias = true;
- vimAlias = true;
-
- plugins = with pkgs.vimPlugins; [
- vimtex
- (nvim-treesitter.withPlugins (p: [ p.lua p.nix p.rust p.python p.bash p.latex p.c])) # Syntax highlighting + language servers
- telescope-nvim # File search
- plenary-nvim # Lua functions
- which-key-nvim # Keybind suggestions
- catppuccin-nvim # Catppuccin theme
- nvim-tree-lua # Tree file browser
- nvim-web-devicons # Icons
- orgmode # Obsidian.md stuff for neovim
- toggleterm-nvim # Togglable terminal in Neovim
- {
- plugin = vim-startify; # Add the plugin and its coresponding config
- config = "let g:startify_change_to_vcs_root = 0";
+-------------------------------------------------
+-- 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",
+ transparent_background = false,
+})
+vim.cmd.colorscheme("catppuccin")
+
+-------------------------------------------------
+-- TREESITTER (IDE-like syntax highlighting)
+-------------------------------------------------
+require("nvim-treesitter.configs").setup({
+ highlight = {
+ enable = true,
+ additional_vim_regex_highlighting = false,
+ },
+ indent = { enable = true },
+
+ incremental_selection = {
+ enable = true,
+ keymaps = {
+ init_selection = "<C-space>",
+ node_incremental = "<C-space>",
+ node_decremental = "<bs>",
+ },
+ },
+})
+
+-------------------------------------------------
+-- TELESCOPE
+-------------------------------------------------
+local telescope = require("telescope")
+local builtin = require("telescope.builtin")
+
+telescope.setup({
+ defaults = {
+ layout_strategy = "horizontal",
+ layout_config = { prompt_position = "top" },
+ sorting_strategy = "ascending",
+ winblend = 0,
+ },
+})
+
+vim.keymap.set("n", "<leader><leader>", builtin.find_files, { desc = "Find files" })
+vim.keymap.set("n", "<leader>ff", builtin.find_files)
+vim.keymap.set("n", "<leader>fg", builtin.live_grep)
+vim.keymap.set("n", "<leader>fb", builtin.buffers)
+vim.keymap.set("n", "<leader>fh", builtin.help_tags)
+
+-------------------------------------------------
+-- WHICH-KEY
+-------------------------------------------------
+require("which-key").setup({})
+
+-------------------------------------------------
+-- TABS
+-------------------------------------------------
+vim.keymap.set("n", "tt", "<cmd>tabnew<CR>", { desc = "New tab" })
+vim.keymap.set("n", "tc", "<cmd>tabclose<CR>", { desc = "Close tab" })
+vim.keymap.set("n", "tn", "<cmd>tabnext<CR>", { desc = "Next tab" })
+vim.keymap.set("n", "tp", "<cmd>tabprevious<CR>", { desc = "Previous tab" })
+vim.keymap.set("n", "t0", "<cmd>tabfirst<CR>", { desc = "First tab" })
+vim.keymap.set("n", "t$", "<cmd>tablast<CR>", { desc = "Last tab" })
+
+-------------------------------------------------
+-- NVIM TREE
+-------------------------------------------------
+require("nvim-tree").setup({
+ view = {
+ width = 30,
+ side = "left",
+ },
+
+ renderer = {
+ group_empty = true,
+ },
+
+ filters = {
+ dotfiles = false,
+ git_ignored = true,
+ },
+
+ git = {
+ enable = true,
+ ignore = true,
+ },
+
+ on_attach = function(bufnr)
+ local api = require("nvim-tree.api")
+
+ local function opts(desc)
+ return {
+ desc = "nvim-tree: " .. desc,
+ buffer = bufnr,
+ noremap = true,
+ silent = true,
+ nowait = true,
}
- ];
-
- extraLuaConfig = ''
- vim.g.mapleader = " "
-
- vim.opt.number = true
- vim.opt.relativenumber = true
- vim.opt.clipboard = "unnamedplus"
-
- vim.o.timeout = true
- vim.o.timeoutlen = 300
-
- vim.cmd.colorscheme("catppuccin")
-
- -- KEYBINDS --
- vim.keymap.set("n", "<leader><leader>", function()
- require("telescope.builtin").find_files({
- cwd = vim.loop.cwd(),
- })
- end, { desc = "Find files (cwd)" })
-
- -- TAB KEYBINDS (t-based navigation)
- -- Close tab
- vim.keymap.set("n", "tc", "<cmd>tabclose<CR>", { desc = "Close tab" })
-
- -- Next tab
- vim.keymap.set("n", "tn", "<cmd>tabnext<CR>", { desc = "Next tab" })
-
- -- Previous tab
- vim.keymap.set("n", "tp", "<cmd>tabprevious<CR>", { desc = "Previous tab" })
-
- -- First tab
- vim.keymap.set("n", "t0", "<cmd>tabfirst<CR>", { desc = "First tab" })
-
- -- Last tab
- vim.keymap.set("n", "t$", "<cmd>tablast<CR>", { desc = "Last tab" })
-
-
- -- Catppuccin theme
- require("catppuccin").setup({
- flavour = "mocha", -- latte, frappe, macchiato, mocha
- transparent_background = false,
- })
-
- -- Treesitter
- require("nvim-treesitter.configs").setup({
- highlight = { enable = true },
- indent = { enable = true },
- })
-
- -- Telescope
- local telescope = require("telescope")
- local builtin = require("telescope.builtin")
-
- telescope.setup({
- defaults = {
- layout_strategy = "horizontal",
- layout_config = {
- prompt_position = "top",
- },
- sorting_strategy = "ascending",
- winblend = 0,
- },
- })
-
- -- Which-key keybind show
- require("which-key").setup({
- -- Optional custom config here
- })
-
-
-
- -- Telescope keymaps
- vim.keymap.set("n", "<leader>ff", builtin.find_files)
- vim.keymap.set("n", "<leader>fg", builtin.live_grep)
- vim.keymap.set("n", "<leader>fb", builtin.buffers)
- vim.keymap.set("n", "<leader>fh", builtin.help_tags))
-
- -- File tree
- require("nvim-tree").setup({
- view = {
- width = 30,
- side = "left",
- },
- renderer = {
- group_empty = true,
- },
- filters = {
- dotfiles = false,
- git_ignored = true,
- },
-
- git = {
- enable = true,
- ignore = true,
- },
-
- on_attach = function(bufnr)
- local api = require("nvim-tree.api")
-
- local function opts(desc)
- return {
- desc = "nvim-tree: " .. desc,
- buffer = bufnr,
- noremap = true,
- silent = true,
- nowait = true,
- }
- end
-
- -- load default mappings first
- api.config.mappings.default_on_attach(bufnr)
-
- -- open file in new tab with "t"
- vim.keymap.set("n", "t", function()
- local node = api.tree.get_node_under_cursor()
- if node and node.type == "file" then
- vim.cmd("tabnew " .. node.absolute_path)
- end
- end, opts("Open in new tab"))
- end,
- })
-
- -- Keybind to toggle
- vim.keymap.set("n", "<leader>e", "<cmd>NvimTreeToggle<CR>")
-
- -- Orgmode setup
- require('orgmode').setup({
- org_agenda_files = {'~/Documents/2. Writing/0. SOČ/org/*.org'},
- org_default_notes_file = '~/Documents/2. Writing/0. SOČ/org/index.org',
- })
- ------------------------------------------------------------------
- -- LaTeX configuration (from old LazyVim config)
- ------------------------------------------------------------------
- -- vimtex settings
- vim.g.vimtex_view_method = "zathura"
- vim.g.vimtex_compiler_latexmk = {
- build_dir = "",
- executable = "latexmk",
- options = {
- "-pdf",
- "-interaction=nonstopmode",
- "-synctex=1",
- "-file-line-error",
- },
- }
- -- Let treesitter handle LaTeX highlighting
- vim.g.vimtex_syntax_enabled = 0
-
- -- ToggleTerm setup
- require("toggleterm").setup({
- size = 20,
- open_mapping = [[<c-\>]],
- direction = "float",
- float_opts = {
- border = "rounded",
- },
- })
-
- -- Lazygit floating terminal
- local Terminal = require("toggleterm.terminal").Terminal
-
- local lazygit = Terminal:new({
- cmd = "lazygit",
- hidden = true,
- direction = "float",
- float_opts = {
- border = "rounded",
- },
- })
-
- function _LAZYGIT_TOGGLE()
- lazygit:toggle()
- end
+ end
- vim.keymap.set("n", "<leader>gg", _LAZYGIT_TOGGLE, { desc = "Lazygit" })
-
- -- Auto settings for LaTeX files
- vim.api.nvim_create_autocmd("FileType", {
- pattern = "tex",
- callback = function()
- vim.opt_local.wrap = true
- vim.opt_local.linebreak = true
- vim.opt_local.breakindent = true
- vim.opt_local.breakindentopt = "shift:2"
- vim.opt_local.textwidth = 0
- end,
- })
- '';
- };
-} \ No newline at end of file
+ api.config.mappings.default_on_attach(bufnr)
+
+ -- open file in new tab
+ vim.keymap.set("n", "t", function()
+ local node = api.tree.get_node_under_cursor()
+ if node and node.type == "file" then
+ vim.cmd("tabnew " .. node.absolute_path)
+ end
+ end, opts("Open in new tab"))
+ end,
+})
+
+vim.keymap.set("n", "<leader>e", "<cmd>NvimTreeToggle<CR>")
+
+-------------------------------------------------
+-- TOGGLETERM + LAZYGIT
+-------------------------------------------------
+require("toggleterm").setup({
+ direction = "float",
+ float_opts = { border = "rounded" },
+})
+
+local Terminal = require("toggleterm.terminal").Terminal
+
+local lazygit = Terminal:new({
+ cmd = "lazygit",
+ hidden = true,
+ direction = "float",
+ float_opts = { border = "rounded" },
+})
+
+vim.keymap.set("n", "<leader>gg", function()
+ lazygit:toggle()
+end, { desc = "Lazygit" })
+
+-------------------------------------------------
+-- ORGMODE
+-------------------------------------------------
+require("orgmode").setup({
+ org_agenda_files = { "~/Documents/2. Writing/0. SOČ/org/*.org" },
+ org_default_notes_file = "~/Documents/2. Writing/0. SOČ/org/index.org",
+})
+
+-------------------------------------------------
+-- VIMTEX
+-------------------------------------------------
+vim.g.vimtex_view_method = "zathura"
+vim.g.vimtex_compiler_latexmk = {
+ executable = "latexmk",
+ options = {
+ "-pdf",
+ "-interaction=nonstopmode",
+ "-synctex=1",
+ "-file-line-error",
+ },
+}
+vim.g.vimtex_syntax_enabled = 0
+
+vim.api.nvim_create_autocmd("FileType", {
+ pattern = "tex",
+ callback = function()
+ vim.opt_local.wrap = true
+ vim.opt_local.linebreak = true
+ vim.opt_local.breakindent = true
+ vim.opt_local.textwidth = 0
+ end,
+}) \ No newline at end of file