this repo has no description
1
fork

Configure Feed

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

Initial commit

Techno Duck 0e183428

+602
+1
.gitignore
··· 1 + lazy-lock.json
+3
README.md
··· 1 + # NVIM config with [lazy](https://github.com/folke/lazy.nvim) plugin manager. 2 + 3 + I swear this is not (100%) stolen.
+1
init.lua
··· 1 + require('technoduck')
+5
lua/.luarc.json
··· 1 + { 2 + "diagnostics.globals": [ 3 + "trouble" 4 + ] 5 + }
+27
lua/technoduck/init.lua
··· 1 + require("technoduck.set") 2 + require("technoduck.remap") 3 + require("technoduck.lazy_config") 4 + 5 + local augroup = vim.api.nvim_create_augroup 6 + local defaultgroup = augroup('default', {}) 7 + 8 + local autocmd = vim.api.nvim_create_autocmd 9 + 10 + autocmd('LspAttach', { 11 + group = defaultgroup, 12 + callback = function(ev) 13 + local opts = { buffer = ev.buff } 14 + vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) 15 + vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) 16 + vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts) 17 + vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts) 18 + vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts) 19 + vim.keymap.set("n", "<leader>vcf", function() vim.lsp.buf.format({ async = true }) end, opts) 20 + vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.code_references() end, opts) 21 + vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.code_rename() end, opts) 22 + vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts) 23 + end 24 + }) 25 + 26 + vim.g.netrw_browse_split = 0 27 + vim.g.netrw_winsize = 25
+65
lua/technoduck/lazy_config.lua
··· 1 + local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 2 + if not vim.loop.fs_stat(lazypath) then 3 + vim.fn.system({ 4 + "git", 5 + "clone", 6 + "--filter=blob:none", 7 + "https://github.com/folke/lazy.nvim.git", 8 + "--branch=stable", -- latest stable release 9 + lazypath, 10 + }) 11 + end 12 + vim.opt.rtp:prepend(lazypath) 13 + 14 + require("lazy").setup({ 15 + spec = "technoduck.lazy_plugins", 16 + change_detection = { notify = false } 17 + }) 18 + 19 + --[[ 20 + { 21 + 22 + 23 + 24 + use { 25 + 'VonHeikemen/lsp-zero.nvim', 26 + branch = 'v2.x', 27 + requires = { 28 + -- LSP Support 29 + {'neovim/nvim-lspconfig'}, -- Required 30 + {'williamboman/mason.nvim'}, -- Optional 31 + {'williamboman/mason-lspconfig.nvim'}, -- Optional 32 + 33 + 34 + {'hrsh7th/cmp-buffer'}, 35 + {'hrsh7th/cmp-path'}, 36 + {'hrsh7th/cmp-cmdline'}, 37 + 38 + -- Autocompletion 39 + {'hrsh7th/nvim-cmp'}, -- Required 40 + {'hrsh7th/cmp-nvim-lsp'}, -- Required 41 + {'hrsh7th/cmp-nvim-lsp-signature-help'}, 42 + {'L3MON4D3/LuaSnip', 43 + run = "make install_jsregexp", 44 + requires = { 'rafamadriz/friendly-snippets' }}, -- Required 45 + {'saadparwaiz1/cmp_luasnip'}, 46 + 47 + { 'dcampos/nvim-snippy'}, 48 + { 'dcampos/cmp-snippy'}, 49 + 50 + } 51 + } 52 + 53 + use {'simrat39/rust-tools.nvim'} 54 + use { 'nvim-lua/lsp-status.nvim' } 55 + 56 + use 'nvim-tree/nvim-web-devicons' 57 + use { 58 + 'nvim-lualine/lualine.nvim', 59 + requires = { 'nvim-tree/nvim-web-devicons', opt = true } 60 + } 61 + 62 + 63 + } 64 + ) 65 + --]]
+15
lua/technoduck/lazy_plugins/colorscheme.lua
··· 1 + return { 2 + "catppuccin/nvim", 3 + 4 + {'folke/tokyonight.nvim', 5 + config = function() 6 + function ColorMyPencils(color) 7 + color = color or "tokyonight" 8 + vim.cmd.colorscheme(color) 9 + 10 + --vim.api.nvim_set_hl(0,"Normal", {bg = "none"}) 11 + --vim.api.nvim_set_hl(0,"NormalFloat", {bg = "none"}) 12 + end 13 + ColorMyPencils("tokyonight-night") 14 + end} 15 + }
+6
lua/technoduck/lazy_plugins/fugitive.lua
··· 1 + return { 2 + 'tpope/vim-fugitive', 3 + config = function() 4 + vim.keymap.set("n", "<leader>gs", vim.cmd.Git) 5 + end 6 + }
+23
lua/technoduck/lazy_plugins/harpoon.lua
··· 1 + return { 2 + 'theprimeagen/harpoon', 3 + branch = "harpoon2", 4 + dependencies = { "nvim-lua/plenary.nvim" }, 5 + config = function() 6 + local harpoon = require("harpoon") 7 + harpoon:setup() 8 + 9 + 10 + vim.keymap.set("n", "<leader>a", function() harpoon:list():append() end) 11 + vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) 12 + 13 + vim.keymap.set("n", "<C-h>", function() harpoon:list():select(1) end) 14 + vim.keymap.set("n", "<C-t>", function() harpoon:list():select(2) end) 15 + vim.keymap.set("n", "<C-n>", function() harpoon:list():select(3) end) 16 + vim.keymap.set("n", "<C-s>", function() harpoon:list():select(4) end) 17 + 18 + -- Toggle previous & next buffers stored within Harpoon list 19 + vim.keymap.set("n", "<C-S-P>", function() harpoon:list():prev() end) 20 + vim.keymap.set("n", "<C-S-N>", function() harpoon:list():next() end) 21 + 22 + end 23 + }
+16
lua/technoduck/lazy_plugins/init.lua
··· 1 + return { 2 + {'nvim-lua/plenary.nvim', 3 + name = "plenary" }, 4 + 5 + 'Shougo/context_filetype.vim', 6 + { 7 + 'windwp/nvim-autopairs', 8 + config = function() 9 + require("nvim-autopairs").setup {} 10 + end 11 + }, 12 + 13 + 14 + 'nvim-treesitter/playground', 15 + 'mbbill/undotree', 16 + }
+161
lua/technoduck/lazy_plugins/lsp.lua
··· 1 + return { 2 + 'neovim/nvim-lspconfig', 3 + dependencies = { 4 + 'williamboman/mason-lspconfig.nvim', 5 + "williamboman/mason.nvim", 6 + 'neovim/nvim-lspconfig', 7 + 'hrsh7th/cmp-nvim-lsp', 8 + 'hrsh7th/cmp-buffer', 9 + 'hrsh7th/cmp-path', 10 + 'hrsh7th/cmp-cmdline', 11 + 'micangl/cmp-vimtex', 12 + 'hrsh7th/nvim-cmp', 13 + 'windwp/nvim-autopairs', 14 + { 15 + 'L3MON4D3/LuaSnip', 16 + build = "make install_jsregexp", 17 + dependencies = { 18 + 'rafamadriz/friendly-snippets' 19 + }, 20 + }, 21 + 'j-hui/fidget.nvim', 22 + }, 23 + config = function() 24 + require('fidget').setup({}) 25 + require("nvim-autopairs").setup({}) 26 + require("mason").setup() 27 + require("mason-lspconfig").setup({ 28 + ensure_installed = { 29 + 'clangd', 30 + 'lua_ls', 31 + 'rust_analyzer', 32 + 'jedi_language_server', 33 + 'texlab', 34 + }, 35 + handlers = { 36 + function(server_name) 37 + local cmp_nvim_lsp = require("cmp_nvim_lsp") 38 + local capabilities = vim.tbl_deep_extend( 39 + "force", 40 + {}, 41 + vim.lsp.protocol.make_client_capabilities(), 42 + cmp_nvim_lsp.default_capabilities()) 43 + 44 + require("lspconfig")[server_name].setup { 45 + capabilities = capabilities 46 + } 47 + require("lspconfig").lua_ls.setup({ 48 + settings = { 49 + Lua = { 50 + diagnostics = { 51 + -- Get the language server to recognize the `vim` global 52 + globals = { 'vim' }, 53 + }, 54 + workspace = { 55 + checkThirdParty = false, 56 + library = { 57 + vim.env.VIMRUNTIME 58 + } 59 + } 60 + } 61 + } 62 + }) 63 + end, 64 + } 65 + }) 66 + 67 + 68 + local has_words_before = function() 69 + unpack = unpack or table.unpack 70 + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) 71 + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil 72 + end 73 + 74 + 75 + local cmp = require('cmp') 76 + local cmp_autopairs = require('nvim-autopairs.completion.cmp') 77 + 78 + 79 + local luasnip = require('luasnip') 80 + -- require("luasnip.loaders.from_vscode").lazy_load() 81 + 82 + cmp.event:on( 83 + 'confirm_done', 84 + cmp_autopairs.on_confirm_done() 85 + ) 86 + local cmp_select = { behaviour = cmp.SelectBehavior.Insert } 87 + cmp.setup({ 88 + snippet = { 89 + expand = function(args) 90 + require('luasnip').lsp_expand(args.body) -- For `luasnip` users. 91 + end, 92 + }, 93 + mapping = cmp.mapping.preset.insert({ 94 + ['<C-p>'] = cmp.mapping.select_prev_item(cmp_select), 95 + ['<C-n>'] = cmp.mapping.select_next_item(cmp_select), 96 + ['<CR>'] = cmp.mapping.confirm({ select = true, behavior = cmp.ConfirmBehavior.Replace, }), 97 + ['<C-Space>'] = cmp.mapping.complete(), 98 + ['<C-u>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }), 99 + ['<C-d>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }), 100 + ["<Tab>"] = cmp.mapping(function(fallback) 101 + if cmp.visible() then 102 + cmp.select_next_item() 103 + -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() 104 + -- they way you will only jump inside the snippet region 105 + elseif luasnip.expand_or_jumpable() then 106 + luasnip.expand_or_jump() 107 + elseif has_words_before() then 108 + cmp.complete() 109 + else 110 + fallback() 111 + end 112 + end, { "i", "s" }), 113 + 114 + ["<S-Tab>"] = cmp.mapping(function(fallback) 115 + if cmp.visible() then 116 + cmp.select_prev_item() 117 + elseif luasnip.jumpable(-1) then 118 + luasnip.jump(-1) 119 + else 120 + fallback() 121 + end 122 + end, { "i", "s" }), 123 + }), 124 + sources = cmp.config.sources({ 125 + { name = 'nvim_lsp' }, 126 + { name = 'vimtex' }, 127 + { name = 'luasnip' }, -- For luasnip users. 128 + }, { 129 + { name = 'buffer' }, 130 + }) 131 + }) 132 + cmp.setup.cmdline({ '/', '?' }, { 133 + mapping = cmp.mapping.preset.cmdline(), 134 + sources = { 135 + { name = 'buffer' } 136 + } 137 + }) 138 + 139 + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). 140 + cmp.setup.cmdline(':', { 141 + mapping = cmp.mapping.preset.cmdline(), 142 + sources = cmp.config.sources({ 143 + { name = 'path' } 144 + }, { 145 + { name = 'cmdline' } 146 + }) 147 + }) 148 + 149 + vim.diagnostic.config({ 150 + update_in_insert = true, 151 + float = { 152 + focusable = false, 153 + style = "minimal", 154 + border = "rounded", 155 + source = "always", 156 + header = "", 157 + prefix = "", 158 + } 159 + }) 160 + end 161 + }
+97
lua/technoduck/lazy_plugins/lualine.lua
··· 1 + 2 + return { 3 + {'nvim-lualine/lualine.nvim', 4 + dependencies = { 'nvim-tree/nvim-web-devicons',lazy=true}, 5 + config = function() 6 + require('lualine').setup { 7 + options = { 8 + icons_enabled = true, 9 + theme = 'auto', 10 + --component_separators = { left = '', right = ''}, 11 + --section_separators = { left = '', right = ''}, 12 + component_separators = { left = '', right = ''}, 13 + section_separators = { left = '', right = ''}, 14 + disabled_filetypes = { 15 + statusline = {}, 16 + winbar = {}, 17 + }, 18 + ignore_focus = {}, 19 + always_divide_middle = true, 20 + globalstatus = false, 21 + refresh = { 22 + statusline = 1000, 23 + tabline = 1000, 24 + winbar = 1000, 25 + } 26 + }, 27 + sections = { 28 + lualine_a = {'mode'}, 29 + lualine_b = {'branch', 'diff', 'diagnostics'}, 30 + lualine_c = {'filename'}, 31 + lualine_x = {"require'lsp-status'.status()",'encoding', 'fileformat', 'filetype'}, 32 + lualine_y = {'progress'}, 33 + lualine_z = {'location'} 34 + }, 35 + inactive_sections = { 36 + lualine_a = {}, 37 + lualine_b = {}, 38 + lualine_c = {'filename'}, 39 + lualine_x = {"require'lsp-status'.status()", 'location'}, 40 + lualine_y = {}, 41 + lualine_z = {} 42 + }, 43 + tabline = {}, 44 + winbar = {}, 45 + inactive_winbar = {}, 46 + extensions = {} 47 + } 48 + end 49 + }, 50 + -- Webicons config 51 + -- 52 + {'nvim-web-devicons', 53 + config = function() 54 + require('nvim-web-devicons').setup { 55 + -- your personnal icons can go here (to override) 56 + -- you can specify color or cterm_color instead of specifying both of them 57 + -- DevIcon will be appended to `name` 58 + override = { 59 + zsh = { 60 + icon = "", 61 + color = "#428850", 62 + cterm_color = "65", 63 + name = "Zsh" 64 + } 65 + }; 66 + -- globally enable different highlight colors per icon (default to true) 67 + -- if set to false all icons will have the default icon's color 68 + color_icons = true; 69 + -- globally enable default icons (default to false) 70 + -- will get overriden by `get_icons` option 71 + default = true; 72 + -- globally enable "strict" selection of icons - icon will be looked up in 73 + -- different tables, first by filename, and if not found by extension; this 74 + -- prevents cases when file doesn't have any extension but still gets some icon 75 + -- because its name happened to match some extension (default to false) 76 + strict = true; 77 + -- same as `override` but specifically for overrides by filename 78 + -- takes effect when `strict` is true 79 + override_by_filename = { 80 + [".gitignore"] = { 81 + icon = "", 82 + color = "#f1502f", 83 + name = "Gitignore" 84 + } 85 + }; 86 + -- same as `override` but specifically for overrides by extension 87 + -- takes effect when `strict` is true 88 + override_by_extension = { 89 + ["log"] = { 90 + icon = "", 91 + color = "#81e043", 92 + name = "Log" 93 + } 94 + }; 95 + } 96 + end}, 97 + }
+15
lua/technoduck/lazy_plugins/neogen.lua
··· 1 + return { 2 + "danymat/neogen", 3 + dependencies = { 4 + "nvim-treesitter/nvim-treesitter", 5 + "L3MON4D3/LuaSnip", 6 + }, 7 + config = function () 8 + local neogen = require("neogen") 9 + neogen.setup({ 10 + snippet_engine = "luasnip" 11 + }) 12 + vim.keymap.set("n", "<leader>nf", function() neogen.generate({type = "func"}) end) 13 + vim.keymap.set("n", "<leader>nc", function() neogen.generate({type = "class"}) end) 14 + end, 15 + }
+16
lua/technoduck/lazy_plugins/snippets.lua
··· 1 + return { 2 + 3 + 'L3MON4D3/LuaSnip', 4 + build = "make install_jsregexp", 5 + dependencies = { 6 + 'rafamadriz/friendly-snippets' 7 + }, 8 + config = function () 9 + ls = require("luasnip") 10 + require("luasnip.loaders.from_vscode").lazy_load() 11 + require("luasnip").filetype_extend("python", { "pydoc" }) 12 + require("luasnip").filetype_extend("rust", { "rustdoc" }) 13 + require("luasnip").filetype_extend("c", { "cdoc" }) 14 + require("luasnip").filetype_extend("cpp", { "cppdoc" }) 15 + end 16 + }
+16
lua/technoduck/lazy_plugins/telescope.lua
··· 1 + return { 2 + 3 + 'nvim-telescope/telescope.nvim', 4 + dependencies = { 5 + 'nvim-lua/plenary.nvim', 6 + 'BurntSushi/ripgrep',}, 7 + 8 + config = function() 9 + local builtin = require('telescope.builtin') 10 + vim.keymap.set('n', '<leader>pf', builtin.find_files, {}) 11 + vim.keymap.set('n', '<C-p>', builtin.git_files, {}) 12 + vim.keymap.set('n', '<leader>ps', function() 13 + builtin.grep_string({search = vim.fn.input("Grep > ")}); 14 + end) 15 + end 16 + }
+25
lua/technoduck/lazy_plugins/treesitter.lua
··· 1 + return { 2 + 'nvim-treesitter/nvim-treesitter', 3 + --build = ":TSUpdate", 4 + config = function() 5 + require('nvim-treesitter.configs').setup({ 6 + -- A list of parser names, or "all" (the five listed parsers should always be installed) 7 + ensure_installed = {"javascript","typescript","python","rust","c", "lua", "vim", "vimdoc", "query","doxygen" }, 8 + 9 + -- Install parsers synchronously (only applied to `ensure_installed`) 10 + sync_install = false, 11 + 12 + -- Automatically install missing parsers when entering buffer 13 + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally 14 + auto_install = true, 15 + indent = { 16 + enable = true 17 + }, 18 + 19 + highlight = { 20 + enable = true, 21 + 22 + additional_vim_regex_highlighting = false, 23 + }, 24 + }) 25 + end}
+16
lua/technoduck/lazy_plugins/trouble.lua
··· 1 + return { 2 + "folke/trouble.nvim", 3 + dependencies = { "nvim-tree/nvim-web-devicons" }, 4 + config = function() 5 + local trouble = require("trouble") 6 + vim.keymap.set("n","<leader>tt", function () 7 + trouble.toggle() 8 + end) 9 + vim.keymap.set("n","]d", function () 10 + trouble.next({skip_groups = true, jump = true}) 11 + end) 12 + vim.keymap.set("n","[d", function () 13 + trouble.previous({skip_groups = true, jump = true}) 14 + end) 15 + end 16 + }
+6
lua/technoduck/lazy_plugins/undotree.lua
··· 1 + return { 2 + 'mbbill/undotree', 3 + config = function() 4 + vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle) 5 + end 6 + }
+7
lua/technoduck/lazy_plugins/vimtex.lua
··· 1 + return { 2 + 'lervag/vimtex', 3 + config = function() 4 + vim.g.vimtex_view_method = 'zathura' 5 + vim.conceallevel="0" 6 + vim.g.tex_conceal="0" 7 + end }
+48
lua/technoduck/remap.lua
··· 1 + vim.g.mapleader = "," 2 + vim.keymap.set("n", "<leader>pv", vim.cmd.Ex) 3 + vim.keymap.set("n", "<leader>tt", vim.cmd.terminal) 4 + 5 + vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv") 6 + vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv") 7 + 8 + vim.keymap.set("n", "J", "mzJ`z") 9 + vim.keymap.set("n", "<C-d>", "<C-d>zz") 10 + vim.keymap.set("n", "<C-u>", "<C-u>zz") 11 + vim.keymap.set("n", "n", "nzzzv") 12 + vim.keymap.set("n", "N", "NzzzV") 13 + 14 + vim.keymap.set("x", "<leader>p", "\"_dP") 15 + 16 + vim.keymap.set("n", "<leader>f", function() 17 + vim.lsp.buf.format() 18 + end) 19 + 20 + vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz") 21 + vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz") 22 + vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz") 23 + vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz") 24 + 25 + vim.keymap.set("n","<leader>x","<cmd>!chmod +x %<CR>", {silent = true}) 26 + 27 + --local ls = require('luasnip') 28 + --vim.keymap.set({"i"}, "<C-K>", function() ls.expand() end, {silent = true}) 29 + --vim.keymap.set({"i", "s"}, "<C-L>", function() ls.jump( 1) end, {silent = true}) 30 + --vim.keymap.set({"i", "s"}, "<C-J>", function() ls.jump(-1) end, {silent = true}) 31 + -- 32 + --vim.keymap.set({"i", "s"}, "<C-E>", function() 33 + -- if ls.choice_active() then 34 + -- ls.change_choice(1) 35 + -- end 36 + --end, {silent = true}) 37 + 38 + vim.cmd('cnoreabbrev W! w!') 39 + vim.cmd('cnoreabbrev Q! q!') 40 + vim.cmd('cnoreabbrev Qall! qall!') 41 + vim.cmd('cnoreabbrev Wq wq') 42 + vim.cmd('cnoreabbrev Wa wa') 43 + vim.cmd('cnoreabbrev wQ wq') 44 + vim.cmd('cnoreabbrev WQ wq') 45 + vim.cmd('cnoreabbrev W w') 46 + vim.cmd('cnoreabbrev Q q') 47 + vim.cmd('cnoreabbrev Qall qall') 48 +
+33
lua/technoduck/set.lua
··· 1 + --vim.opt.guicursor = "" 2 + vim.opt.nu = true 3 + vim.opt.relativenumber = true 4 + 5 + vim.opt.clipboard = "unnamedplus,unnamed" 6 + 7 + vim.opt.tabstop = 4 8 + vim.opt.softtabstop = 4 9 + vim.opt.shiftwidth = 4 10 + vim.opt.expandtab = true 11 + 12 + vim.opt.smartindent = true 13 + 14 + vim.opt.wrap = false 15 + 16 + vim.opt.swapfile = false 17 + vim.opt.backup = false 18 + vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" 19 + vim.opt.undofile = true 20 + 21 + vim.opt.hlsearch = false 22 + vim.opt.incsearch = true 23 + 24 + vim.opt.termguicolors = true 25 + 26 + vim.opt.scrolloff = 8 27 + vim.opt.signcolumn = "yes" 28 + vim.opt.isfname:append("@-@") 29 + 30 + vim.updatetime = 50 31 + 32 + --vim.opt.colorcolumn = "100" 33 +