├── init.lua ├── lua └── neocat │ ├── mini.lua │ ├── format.lua │ ├── langs.lua │ ├── theme.lua │ ├── opts.lua │ ├── telescope.lua │ ├── cmp.lua │ ├── lsp_setup.lua │ ├── treesitter.lua │ ├── init.lua │ └── pck.lua └── lazy-lock.json /init.lua: -------------------------------------------------------------------------------- 1 | require('neocat') 2 | 3 | -------------------------------------------------------------------------------- /lua/neocat/mini.lua: -------------------------------------------------------------------------------- 1 | return function() 2 | -- more / better textobjects 3 | require("mini.ai").setup({ n_lines = 500 }) 4 | 5 | -- delete / add surrounding 6 | -- [S]urround [A]dd / [D]elete / [R]eplace textobject quote 7 | require("mini.surround").setup() 8 | end 9 | -------------------------------------------------------------------------------- /lua/neocat/format.lua: -------------------------------------------------------------------------------- 1 | return { 2 | formatters_by_ft = { 3 | lua = { 'stylua' }, 4 | rust = { 'rustfmt' }, 5 | python = { 'black' } 6 | }, 7 | format_on_save = { 8 | -- These options will be passed to conform.format() 9 | timeout_ms = 500, 10 | lsp_format = "fallback", 11 | }, 12 | 13 | } 14 | -------------------------------------------------------------------------------- /lua/neocat/langs.lua: -------------------------------------------------------------------------------- 1 | return { 2 | clangd = {}, 3 | -- gopls = {}, 4 | pyright = {}, 5 | rust_analyzer = {}, 6 | zls = {}, 7 | ts_ls = {}, 8 | -- html = { filetypes = { 'html', 'twig', 'hbs'} }, 9 | 10 | lua_ls = { 11 | Lua = { 12 | workspace = { checkThirdParty = false }, 13 | telemetry = { enable = false }, 14 | -- NOTE: toggle below to ignore Lua_LS's noisy `missing-fields` warnings 15 | -- diagnostics = { disable = { 'missing-fields' } }, 16 | }, 17 | }, 18 | 19 | ansiblels = {}, 20 | -- wgsl_analyzer = {}, 21 | } 22 | -------------------------------------------------------------------------------- /lua/neocat/theme.lua: -------------------------------------------------------------------------------- 1 | -- colors: https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md 2 | -- its pretty easy to seach the repo for specific overwrites 3 | 4 | return { 5 | flavour = "mocha", 6 | color_overrides = { 7 | mocha = { 8 | base = "#000000", 9 | mantle = "#000000", 10 | crust = "#000000", 11 | surface0 = "#11111b", 12 | }, 13 | }, 14 | custom_highlights = function(colors) 15 | return { 16 | FloatBorder = { fg = colors.lavender }, 17 | TelescopeMatching = { fg = colors.pink }, 18 | } 19 | end, 20 | integrations = { 21 | cmp = true, 22 | treesitter = true, 23 | mini = true, 24 | telescope = true, 25 | lsp_trouble = true, 26 | }, 27 | } 28 | -------------------------------------------------------------------------------- /lua/neocat/opts.lua: -------------------------------------------------------------------------------- 1 | vim.g.mapleader = ' ' 2 | vim.g.maplocalleader = ' ' 3 | 4 | vim.opt.tabstop = 2 5 | vim.opt.shiftwidth = 2 6 | vim.opt.expandtab = true 7 | 8 | vim.o.hlsearch = false 9 | -- linewrap follows indentation 10 | vim.o.breakindent = true 11 | -- persisten undo history 12 | vim.o.undofile = true 13 | 14 | -- case insensitive search except when using uppercase or \C 15 | vim.o.ignorecase = true 16 | vim.o.smartcase = true 17 | 18 | vim.wo.number = true 19 | vim.wo.signcolumn = 'yes' 20 | vim.wo.relativenumber = true 21 | 22 | vim.o.timeoutlen = 500 23 | 24 | -- show completions even if there is only one 25 | -- dont complete unless i select something 26 | vim.o.completeopt = 'menuone,noselect' 27 | 28 | -- should probably check if this is supported first 29 | vim.o.termguicolors = true 30 | 31 | vim.o.background = 'dark' 32 | -------------------------------------------------------------------------------- /lua/neocat/telescope.lua: -------------------------------------------------------------------------------- 1 | -- telescope native fzf 2 | pcall(require("telescope").load_extension, "fzf") 3 | 4 | -- telescope bindings 5 | vim.keymap.set("n", "fs", require("telescope.builtin").builtin, { desc = "[F]ind [S]elect Telescope" }) 6 | vim.keymap.set("n", "gf", require("telescope.builtin").git_files, { desc = "Search [G]it [F]iles" }) 7 | vim.keymap.set("n", "ff", require("telescope.builtin").find_files, { desc = "[F]ind [F]iles" }) 8 | vim.keymap.set("n", "fw", require("telescope.builtin").grep_string, { desc = "[F]ind current [W]ord" }) 9 | vim.keymap.set("n", "fg", require("telescope.builtin").live_grep, { desc = "[F]ind [G]rep" }) 10 | vim.keymap.set("n", "fd", require("telescope.builtin").diagnostics, { desc = "[F]ind [D]iagnostics" }) 11 | vim.keymap.set("n", "fr", require("telescope.builtin").resume, { desc = "[F]ind [R]esume" }) 12 | -------------------------------------------------------------------------------- /lua/neocat/cmp.lua: -------------------------------------------------------------------------------- 1 | -- [[ Configure nvim-cmp ]] 2 | -- See `:help cmp` 3 | local cmp = require 'cmp' 4 | local luasnip = require 'luasnip' 5 | require('luasnip.loaders.from_vscode').lazy_load() 6 | luasnip.config.setup {} 7 | 8 | cmp.setup { 9 | snippet = { 10 | expand = function(args) 11 | luasnip.lsp_expand(args.body) 12 | end, 13 | }, 14 | completion = { 15 | completeopt = 'menu,menuone,noinsert', 16 | }, 17 | mapping = cmp.mapping.preset.insert { 18 | [''] = cmp.mapping.scroll_docs(-4), 19 | [''] = cmp.mapping.scroll_docs(4), 20 | [''] = cmp.mapping.complete {}, 21 | [''] = cmp.mapping.confirm { 22 | behavior = cmp.ConfirmBehavior.Replace, 23 | select = true, 24 | }, 25 | [''] = cmp.mapping(function(fallback) 26 | if cmp.visible() then 27 | cmp.select_next_item() 28 | elseif luasnip.expand_or_locally_jumpable() then 29 | luasnip.expand_or_jump() 30 | else 31 | fallback() 32 | end 33 | end, { 'i', 's' }), 34 | [''] = cmp.mapping(function(fallback) 35 | if cmp.visible() then 36 | cmp.select_prev_item() 37 | elseif luasnip.locally_jumpable(-1) then 38 | luasnip.jump(-1) 39 | else 40 | fallback() 41 | end 42 | end, { 'i', 's' }), 43 | }, 44 | sources = { 45 | { name = 'nvim_lsp' }, 46 | { name = 'luasnip' }, 47 | { name = 'path' }, 48 | }, 49 | } 50 | -------------------------------------------------------------------------------- /lua/neocat/lsp_setup.lua: -------------------------------------------------------------------------------- 1 | return function(_, bufnr) 2 | local nmap = function(keys, func, desc) 3 | vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc }) 4 | end 5 | 6 | vim.diagnostic.config({ 7 | virtual_text = true, 8 | signs = true, 9 | underline = true, 10 | update_in_insert = false, 11 | severity_sort = true, 12 | }) 13 | 14 | nmap("rn", vim.lsp.buf.rename, "[R]e[n]ame") 15 | nmap("ca", vim.lsp.buf.code_action, "[C]ode [A]ction") 16 | 17 | nmap("gd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition") 18 | nmap("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences") 19 | nmap("gI", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation") 20 | nmap("D", require("telescope.builtin").lsp_type_definitions, "Type [D]efinition") 21 | nmap("ds", require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols") 22 | nmap("ws", require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols") 23 | 24 | -- See `:help K` for why this keymap 25 | nmap("K", vim.lsp.buf.hover, "Hover Documentation") 26 | nmap("K", vim.lsp.buf.signature_help, "Signature Documentation") 27 | 28 | -- Lesser used LSP functionality 29 | nmap("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration") 30 | nmap("wl", function() 31 | print(vim.inspect(vim.lsp.buf.list_workspace_folders())) 32 | end, "[W]orkspace [L]ist Folders") 33 | end 34 | -------------------------------------------------------------------------------- /lua/neocat/treesitter.lua: -------------------------------------------------------------------------------- 1 | require('nvim-treesitter.configs').setup { 2 | -- Add languages to be installed here that you want installed for treesitter 3 | ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'javascript', 'typescript', 'vimdoc', 'bash' }, 4 | 5 | -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) 6 | auto_install = false, 7 | -- Install languages synchronously (only applied to `ensure_installed`) 8 | sync_install = false, 9 | -- List of parsers to ignore installing 10 | ignore_install = {}, 11 | -- You can specify additional Treesitter modules here: -- For example: -- playground = {--enable = true,-- }, 12 | modules = {}, 13 | highlight = { enable = true }, 14 | indent = { enable = true }, 15 | incremental_selection = { 16 | enable = true, 17 | keymaps = { 18 | init_selection = '', 19 | node_incremental = '', 20 | scope_incremental = '', 21 | node_decremental = '', 22 | }, 23 | }, 24 | textobjects = { 25 | select = { 26 | enable = true, 27 | lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim 28 | keymaps = { 29 | -- You can use the capture groups defined in textobjects.scm 30 | ['aa'] = '@parameter.outer', 31 | ['ia'] = '@parameter.inner', 32 | ['af'] = '@function.outer', 33 | ['if'] = '@function.inner', 34 | ['ac'] = '@class.outer', 35 | ['ic'] = '@class.inner', 36 | }, 37 | }, 38 | move = { 39 | enable = true, 40 | set_jumps = true, -- whether to set jumps in the jumplist 41 | goto_next_start = { 42 | [']m'] = '@function.outer', 43 | [']]'] = '@class.outer', 44 | }, 45 | goto_next_end = { 46 | [']M'] = '@function.outer', 47 | [']['] = '@class.outer', 48 | }, 49 | goto_previous_start = { 50 | ['[m'] = '@function.outer', 51 | ['[['] = '@class.outer', 52 | }, 53 | goto_previous_end = { 54 | ['[M'] = '@function.outer', 55 | ['[]'] = '@class.outer', 56 | }, 57 | }, 58 | swap = { 59 | enable = true, 60 | swap_next = { 61 | ['a'] = '@parameter.inner', 62 | }, 63 | swap_previous = { 64 | ['A'] = '@parameter.inner', 65 | }, 66 | }, 67 | }, 68 | } 69 | -------------------------------------------------------------------------------- /lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, 3 | "blackmagic": { "branch": "main", "commit": "4e54eb32bb533ebe6ea87875c537fc2d9e04bd36" }, 4 | "catppuccin": { "branch": "main", "commit": "5b5e3aef9ad7af84f463d17b5479f06b87d5c429" }, 5 | "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, 6 | "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, 7 | "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, 8 | "conform.nvim": { "branch": "master", "commit": "b1a75324ddf96b7bb84963a297b1ed334db087c0" }, 9 | "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, 10 | "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, 11 | "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, 12 | "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, 13 | "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, 14 | "luvit-meta": { "branch": "main", "commit": "1df30b60b1b4aecfebc785aa98943db6c6989716" }, 15 | "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, 16 | "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, 17 | "mini.nvim": { "branch": "main", "commit": "9af69d8c655e609a7eb043e8f9c27530580d4838" }, 18 | "nvim-cmp": { "branch": "main", "commit": "059e89495b3ec09395262f16b1ad441a38081d04" }, 19 | "nvim-lspconfig": { "branch": "master", "commit": "40f120c10ea4b87311175539a183c3b75eab95a3" }, 20 | "nvim-treesitter": { "branch": "master", "commit": "997288c55253e27f782d991099490f80205d65bf" }, 21 | "nvim-treesitter-context": { "branch": "master", "commit": "93b29a32d5f4be10e39226c6b796f28d68a8b483" }, 22 | "nvim-treesitter-textobjects": { "branch": "master", "commit": "9937e5e356e5b227ec56d83d0a9d0a0f6bc9cad4" }, 23 | "nvim-web-devicons": { "branch": "master", "commit": "4c3a5848ee0b09ecdea73adcd2a689190aeb728c" }, 24 | "oil.nvim": { "branch": "master", "commit": "302bbaceeafc690e6419e0c8296e804d60cb9446" }, 25 | "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, 26 | "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, 27 | "telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" }, 28 | "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, 29 | "vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" }, 30 | "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" } 31 | } 32 | -------------------------------------------------------------------------------- /lua/neocat/init.lua: -------------------------------------------------------------------------------- 1 | require("neocat.opts") 2 | 3 | -- easy pane switching 4 | vim.keymap.set("n", "", "", { silent = true, remap = false }) 5 | vim.keymap.set("n", "", "", { silent = true, remap = false }) 6 | vim.keymap.set("n", "", "", { silent = true, remap = false }) 7 | vim.keymap.set("n", "", "", { silent = true, remap = false }) 8 | 9 | -- dont do anything on normal mode space 10 | vim.keymap.set({ "n", "v" }, "", "", { silent = true }) 11 | 12 | -- i trust tj on this one 13 | vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) 14 | vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) 15 | 16 | -- [[ Highlight on yank ]] 17 | -- See `:help vim.highlight.on_yank()` 18 | local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true }) 19 | vim.api.nvim_create_autocmd("TextYankPost", { 20 | callback = function() 21 | vim.highlight.on_yank() 22 | end, 23 | group = highlight_group, 24 | pattern = "*", 25 | }) 26 | 27 | -- setup plugins 28 | require("neocat.pck") 29 | 30 | vim.cmd.colorscheme("blackmagic") 31 | 32 | require("neocat.telescope") 33 | 34 | -- [[ Configure Treesitter ]] 35 | -- See `:help nvim-treesitter` 36 | -- Defer Treesitter setup after first render to improve startup time of 'nvim {filename}' 37 | vim.defer_fn(function() 38 | require("neocat.treesitter") 39 | end, 0) 40 | 41 | -- LSP 42 | local on_attach = require("neocat.lsp_setup") 43 | 44 | -- mason-lspconfig requires that these setup functions are called in this order 45 | -- before setting up the servers. 46 | require("mason").setup() 47 | require("mason-lspconfig").setup() 48 | 49 | vim.filetype.add({ extension = { wgsl = "wgsl" } }) 50 | 51 | -- Enable the following language servers 52 | -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. 53 | -- 54 | -- Add any additional override configuration in the following tables. They will be passed to 55 | -- the `settings` field of the server config. You must look up that documentation yourself. 56 | -- 57 | -- If you want to override the default filetypes that your language server will attach to you can 58 | -- define the property 'filetypes' to the map in question. 59 | local servers = require("neocat.langs") 60 | 61 | -- nvim-cmp supports additional completion capabilities, so broadcast that to servers 62 | local capabilities = vim.lsp.protocol.make_client_capabilities() 63 | capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities) 64 | 65 | -- Ensure the servers above are installed 66 | local mason_lspconfig = require("mason-lspconfig") 67 | 68 | mason_lspconfig.setup({ 69 | ensure_installed = vim.tbl_keys(servers), 70 | }) 71 | 72 | mason_lspconfig.setup_handlers({ 73 | function(server_name) 74 | require("lspconfig")[server_name].setup({ 75 | capabilities = capabilities, 76 | on_attach = on_attach, 77 | settings = servers[server_name], 78 | filetypes = (servers[server_name] or {}).filetypes, 79 | }) 80 | end, 81 | }) 82 | 83 | require("neocat.cmp") 84 | -------------------------------------------------------------------------------- /lua/neocat/pck.lua: -------------------------------------------------------------------------------- 1 | -- lazy install 2 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 3 | if not vim.loop.fs_stat(lazypath) then 4 | vim.fn.system({ 5 | "git", 6 | "clone", 7 | "--filter=blob:none", 8 | "https://github.com/folke/lazy.nvim.git", 9 | "--branch=stable", -- latest stable release 10 | lazypath, 11 | }) 12 | end 13 | vim.opt.rtp:prepend(lazypath) 14 | 15 | -- setup plugins 16 | require("lazy").setup({ 17 | { 18 | --dir = "/home/catnip/repos/blackmagic", 19 | "sum-catnip/blackmagic", 20 | opts = {}, 21 | }, 22 | 23 | -- all sorts of stuffs 24 | { 25 | "echasnovski/mini.nvim", 26 | config = require("neocat.mini"), 27 | }, 28 | 29 | -- format on save 30 | { 31 | "stevearc/conform.nvim", 32 | opts = require("neocat.format"), 33 | }, 34 | 35 | -- git support 36 | "tpope/vim-fugitive", 37 | -- automatically set tabwidth and related things 38 | "tpope/vim-sleuth", 39 | -- notifications 40 | { "j-hui/fidget.nvim", opts = {} }, 41 | 42 | -- better nvim config editing support 43 | { 44 | "folke/lazydev.nvim", 45 | ft = "lua", -- only load on lua files 46 | opts = { 47 | library = { 48 | -- See the configuration section for more details 49 | -- Load luvit types when the `vim.uv` word is found 50 | { path = "luvit-meta/library", words = { "vim%.uv" } }, 51 | }, 52 | }, 53 | }, 54 | { "Bilal2453/luvit-meta", lazy = true }, -- optional `vim.uv` typings 55 | 56 | { 57 | "neovim/nvim-lspconfig", 58 | dependencies = { 59 | -- use mason to install lsps 60 | "williamboman/mason-lspconfig.nvim", 61 | { "williamboman/mason.nvim", config = true }, 62 | }, 63 | }, 64 | 65 | { 66 | -- autocomplete 67 | "hrsh7th/nvim-cmp", 68 | event = "InsertEnter", 69 | dependencies = { 70 | -- autocomplete sources 71 | "hrsh7th/cmp-nvim-lsp", 72 | "hrsh7th/cmp-path", 73 | "saadparwaiz1/cmp_luasnip", 74 | 75 | -- snippet engine 76 | "L3MON4D3/LuaSnip", 77 | -- snippets 78 | "rafamadriz/friendly-snippets", 79 | }, 80 | -- lazydev completion source for requires 81 | opts = function(_, opts) 82 | opts.sources = opts.sources or {} 83 | table.insert(opts.sources, { 84 | name = "lazydev", 85 | group_index = 0, -- set group index to 0 to skip loading LuaLS completions 86 | }) 87 | end, 88 | }, 89 | 90 | { -- todo: rainbowbracket integration 91 | -- Add indentation guides even on blank lines 92 | "lukas-reineke/indent-blankline.nvim", 93 | -- Enable `lukas-reineke/indent-blankline.nvim` 94 | -- See `:help ibl` 95 | main = "ibl", 96 | -- setting opts causes the modules `setup` function to be called 97 | opts = {}, 98 | }, 99 | 100 | { 101 | "nvim-treesitter/nvim-treesitter", 102 | dependencies = { 103 | "nvim-treesitter/nvim-treesitter-textobjects", 104 | "nvim-treesitter/nvim-treesitter-context", 105 | }, 106 | build = ":TSUpdate", 107 | }, 108 | 109 | { 110 | "nvim-telescope/telescope.nvim", 111 | dependencies = { 112 | "nvim-lua/plenary.nvim", 113 | -- Fuzzy Finder Algorithm which requires local dependencies to be built. 114 | -- Only load if `make` is available. Make sure you have the system 115 | -- requirements installed. 116 | { 117 | "nvim-telescope/telescope-fzf-native.nvim", 118 | -- build with cmake for cross-plat 119 | build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build", 120 | cond = function() 121 | return vim.fn.executable("cmake") == 1 122 | end, 123 | }, 124 | }, 125 | }, 126 | 127 | { 128 | -- lsp diagnostics 129 | "folke/trouble.nvim", 130 | dependencies = { "nvim-tree/nvim-web-devicons" }, 131 | opts = { 132 | -- your configuration comes here 133 | -- or leave it empty to use the default settings 134 | -- refer to the configuration section below 135 | }, 136 | }, 137 | 138 | -- theme 139 | { 140 | "catppuccin/nvim", 141 | name = "catppuccin", 142 | priority = 1000, 143 | opts = require("neocat.theme"), 144 | }, 145 | 146 | -- vim like filesystem 147 | { 148 | "stevearc/oil.nvim", 149 | opts = {}, 150 | -- Optional dependencies 151 | dependencies = { "nvim-tree/nvim-web-devicons" }, 152 | }, 153 | }, {}) 154 | --------------------------------------------------------------------------------