diff options
Diffstat (limited to 'modules/home/i3wm/nord-blue/nvim.nix')
| -rw-r--r-- | modules/home/i3wm/nord-blue/nvim.nix | 314 |
1 files changed, 0 insertions, 314 deletions
diff --git a/modules/home/i3wm/nord-blue/nvim.nix b/modules/home/i3wm/nord-blue/nvim.nix deleted file mode 100644 index ef054a0..0000000 --- a/modules/home/i3wm/nord-blue/nvim.nix +++ /dev/null @@ -1,314 +0,0 @@ -{ - pkgs, - config, - lib, - ... -}: { - ################################################# - # Packages - ################################################# - home.packages = with pkgs; [ - zathura - ripgrep - fd - lazygit - stylua - alejandra - black - shfmt - - # Language servers - lua-language-server - nil - rust-analyzer - pyright - bash-language-server - texlab - ]; - - ################################################# - # Neovim - ################################################# - programs.neovim = { - enable = true; - defaultEditor = true; - viAlias = true; - vimAlias = true; - - ################################################# - # Plugins - ################################################# - plugins = with pkgs.vimPlugins; [ - # UI - catppuccin-nvim - nvim-web-devicons - which-key-nvim - gitsigns-nvim - - # Syntax - (nvim-treesitter.withPlugins (p: [ - p.lua - p.nix - p.rust - p.python - p.bash - p.latex - p.c - ])) - - # LSP - nvim-lspconfig - - # Completion / snippets - nvim-cmp - cmp-nvim-lsp - cmp_luasnip - luasnip - friendly-snippets - nvim-autopairs - - # Formatting - conform-nvim - comment-nvim - - # Navigation - telescope-nvim - plenary-nvim - nvim-tree-lua - - # Terminal - toggleterm-nvim - - # Writing - vimtex - orgmode - - # Start screen - { - plugin = vim-startify; - config = "let g:startify_change_to_vcs_root = 0"; - } - ]; - - ################################################# - # 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 - ------------------------------------------------- - 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" - ''; - }; -} |
