Configuration for my NixOS based systems and Home Manager
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Sync with old dotfiles

+64 -96
+3 -3
nvim/init.lua
··· 10 10 -- Config for Nord, which I usually use 11 11 --vim.g.nord_italic = false 12 12 --vim.g.nord_bold = false 13 - --vim.opt.background = "light" 14 - vim.opt.background = "dark" 13 + vim.opt.background = "light" 14 + --vim.opt.background = "dark" 15 15 16 16 17 17 -- Formatting and vim config ··· 162 162 disable = {} 163 163 }, 164 164 indent = { 165 - enable = false, 165 + enable = true, 166 166 disable = {} 167 167 }, 168 168 ensure_installed = {
+36 -71
nvim/lua/completion.lua
··· 1 - require("compe").setup( 2 - { 3 - enabled = true, 4 - autocomplete = true, 5 - debug = false, 6 - min_length = 1, 7 - preselect = "enable", 8 - throttle_time = 80, 9 - source_timeout = 200, 10 - resolve_timeout = 800, 11 - incomplete_delay = 400, 12 - max_abbr_width = 100, 13 - max_kind_width = 100, 14 - max_menu_width = 100, 15 - documentation = { 16 - border = {"", "", "", " ", "", "", "", " "}, -- the border option is the same as `|help nvim_open_win|` 17 - winhighlight = "NormalFloat:CompeDocumentation,FloatBorder:CompeDocumentationBorder", 18 - max_width = 120, 19 - min_width = 60, 20 - max_height = math.floor(vim.o.lines * 0.3), 21 - min_height = 1 22 - }, 23 - source = { 24 - path = true, 25 - buffer = true, 26 - calc = true, 27 - nvim_lsp = true, 28 - nvim_lua = true, 29 - vsnip = true, 30 - ultisnips = true, 31 - luasnip = true 32 - } 33 - } 34 - ) 35 - local t = function(str) 36 - return vim.api.nvim_replace_termcodes(str, true, true, true) 37 - end 1 + -- Copied from https://github.com/hrsh7th/nvim-cmp/?tab=readme-ov-file#recommended-configuration 2 + local cmp = require('cmp') 3 + cmp.setup({ 4 + snippet = { 5 + -- REQUIRED - you must specify a snippet engine 6 + expand = function(args) 7 + vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. 8 + end 9 + }, 10 + window = { 11 + completion = cmp.config.window.bordered(), 12 + documentation = cmp.config.window.bordered() 13 + }, 14 + mapping = cmp.mapping.preset.insert({ 15 + ['<C-b>'] = cmp.mapping.scroll_docs(-4), 16 + ['<C-f>'] = cmp.mapping.scroll_docs(4), 17 + ['<C-Space>'] = cmp.mapping.complete(), 18 + ['<C-e>'] = cmp.mapping.abort(), 19 + ['<CR>'] = cmp.mapping.confirm({select = true}) -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. 20 + }), 21 + sources = cmp.config.sources({ 22 + {name = 'nvim_lsp'}, {name = 'vsnip'} -- For vsnip users. 23 + }, {{name = 'buffer'}}) 24 + }) 25 + require("cmp_git").setup() 26 + -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). 27 + cmp.setup.cmdline({'/', '?'}, { 28 + mapping = cmp.mapping.preset.cmdline(), 29 + sources = {{name = 'buffer'}} 30 + }) 38 31 39 - local check_back_space = function() 40 - local col = vim.fn.col(".") - 1 41 - return col == 0 or vim.fn.getline("."):sub(col, col):match("%s") ~= nil 42 - end 43 - 44 - -- Use (s-)tab to: 45 - --- move to prev/next item in completion menuone 46 - --- jump to prev/next snippet's placeholder 47 - _G.tab_complete = function() 48 - if vim.fn.pumvisible() == 1 then 49 - return t "<C-n>" 50 - elseif vim.fn["vsnip#available"](1) == 1 then 51 - return t "<Plug>(vsnip-expand-or-jump)" 52 - elseif check_back_space() then 53 - return t "<Tab>" 54 - else 55 - return vim.fn["compe#complete"]() 56 - end 57 - end 58 - _G.s_tab_complete = function() 59 - if vim.fn.pumvisible() == 1 then 60 - return t "<C-p>" 61 - elseif vim.fn["vsnip#jumpable"](-1) == 1 then 62 - return t "<Plug>(vsnip-jump-prev)" 63 - else 64 - -- If <S-Tab> is not working in your terminal, change it to <C-h> 65 - return t "<S-Tab>" 66 - end 67 - end 68 - 69 - vim.api.nvim_set_keymap("i", "<Tab>", "v:lua.tab_complete()", {expr = true}) 70 - vim.api.nvim_set_keymap("s", "<Tab>", "v:lua.tab_complete()", {expr = true}) 71 - vim.api.nvim_set_keymap("i", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true}) 72 - vim.api.nvim_set_keymap("s", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true}) 32 + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). 33 + cmp.setup.cmdline(':', { 34 + mapping = cmp.mapping.preset.cmdline(), 35 + sources = cmp.config.sources({{name = 'path'}}, {{name = 'cmdline'}}), 36 + matching = {disallow_symbol_nonprefix_matching = false} 37 + })
+4 -19
nvim/lua/lsp.lua
··· 1 1 local nvim_lsp = require("lspconfig") 2 + local capabilities = require('cmp_nvim_lsp').default_capabilities() 2 3 --######################## 3 4 --#### Set up LSPs #### 4 5 --######################## 5 - -- 6 - -- TypeScript 7 - nvim_lsp.tsserver.setup { 8 - flags = { 9 - debounce_text_changes = 150 10 - } 11 - } 12 6 13 7 local util = require("lspconfig.util") 14 8 ··· 29 23 end 30 24 } 31 25 ) 32 - --nvim_lsp.scheme_langserver.setup{} 33 - 34 - -- Golang 35 - -- Lots of things 36 - --nvim_lsp.diagnosticls.setup( 37 - -- { 38 - -- flags = { 39 - -- debounce_text_changes = 150 40 - -- } 41 - -- } 42 - --) 43 26 nvim_lsp.lua_ls.setup{ 44 27 settings = { 45 28 Lua = { ··· 106 89 "tsserver", 107 90 "eslint", 108 91 "metals", 92 + -- disabled because it's broken 93 + --"scheme_langserver", 109 94 } 110 95 -- #simple_lsps is the length of the table when treated as a list... funky! 111 96 for _,v in pairs(simple_lsps) do 112 - nvim_lsp[v].setup{} 97 + nvim_lsp[v].setup{ capabilities = capabilities } 113 98 end 114 99 115 100 -- Whenever an LSP is attached to a buffer
+21 -3
nvim/lua/plugins.lua
··· 34 34 "neanias/everforest-nvim", 35 35 version = false, 36 36 lazy = false, 37 - priority = 1000, -- make sure to load this before all the other start plugins 37 + priority = 500, -- make sure to load this before all the other start plugins 38 38 main = "everforest", 39 39 opts = { 40 40 background = "hard", ··· 46 46 }, 47 47 -- show indents and whitespace characters 48 48 "lukas-reineke/indent-blankline.nvim", 49 + 50 + -- Completion 51 + "hrsh7th/nvim-cmp", 52 + "hrsh7th/cmp-nvim-lsp", 53 + "hrsh7th/cmp-buffer", 54 + "hrsh7th/cmp-path", 55 + "hrsh7th/cmp-vsnip", 56 + "hrsh7th/vim-vsnip", 57 + "petertriho/cmp-git", 58 + 49 59 -- Completion 50 60 "hrsh7th/nvim-compe", 51 61 "hrsh7th/vim-vsnip", ··· 67 77 vim.cmd([[":TSUpdate"]]) 68 78 end 69 79 }, 80 + -- Git stuff 70 81 -- GitGutter, shows inline difs 71 82 "airblade/vim-gitgutter", 72 - -- Git wrapper plugin 73 - "tpope/vim-fugitive", 83 + -- "tpope/vim-fugitive", -- old git command 84 + { 85 + "NeogitOrg/neogit", 86 + dependencies = { 87 + "nvim-lua/plenary.nvim", -- required 88 + "sindrets/diffview.nvim", -- optional - Diff integration 89 + "nvim-telescope/telescope.nvim" 90 + }, 91 + }, 74 92 -- surround with pairs )))))) 75 93 --"tpope/vim-surround", 76 94 -- Auto format tool