diff options
author | Matthew Lemon <y@yulqen.org> | 2023-08-13 08:44:49 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2023-08-13 08:44:49 +0100 |
commit | c1d6bc6b4fd5208c7f3df0694f7aab501943981b (patch) | |
tree | ac34ead54ba6682a5c2e0d1a1f569346c76e9c90 /nvim-primeagen | |
parent | 39c92fea8b9e96b2756d94b285dae8cfb015d68f (diff) |
Adds primeagen neovim configuration
Diffstat (limited to 'nvim-primeagen')
25 files changed, 794 insertions, 0 deletions
diff --git a/nvim-primeagen/.gitignore b/nvim-primeagen/.gitignore new file mode 100644 index 0000000..c84aa4a --- /dev/null +++ b/nvim-primeagen/.gitignore @@ -0,0 +1 @@ +plugin/packer_compiled.lua diff --git a/nvim-primeagen/after/plugin/ale.lua b/nvim-primeagen/after/plugin/ale.lua new file mode 100644 index 0000000..b3b5c0d --- /dev/null +++ b/nvim-primeagen/after/plugin/ale.lua @@ -0,0 +1,41 @@ +-- Set the configuration options for the plugin +local linters = { + python = {'ruff', 'flake8', 'pyright'}, + ocaml = {'merlin'}, + cpp = {'clang'}, + yaml = {'yamllint'}, + c = {'clang'}, + go = {'gopls', 'golint', 'gofmt'}, +} + +local fixers = { + python = {'ruff', 'isort', 'yapf', 'black', 'autoimport'}, + go = {'gofmt'}, + rust = {'rustfmt'}, +} + +local pyright_config = { + useLibraryCodeForTypes = 1, + disableLanguageServices = 1, + autoImportCompletions = 1, +} + +vim.api.nvim_set_var('ale_linters', linters) +vim.api.nvim_set_var('ale_python_pyright_config', pyright_config) +vim.api.nvim_set_var('ale_fix_on_save', 1) +vim.api.nvim_set_var('ale_warn_about_trailing_whitespace', 1) +vim.api.nvim_set_var('ale_disable_lsp', 1) +vim.api.nvim_set_var('ale_use_neovim_diagnostics_api', 1) +vim.api.nvim_set_var('ale_set_quickfix', 1) +vim.api.nvim_set_var('ale_echo_cursor', 1) +vim.api.nvim_set_var('ale_echo_msg_error_str', 'Error') +vim.api.nvim_set_var('ale_echo_msg_form', '%linter% - %code: %%s') +vim.api.nvim_set_var('ale_loclist_msg_format', '%linter% - %code: %%s') +vim.api.nvim_set_var('ale_echo_msg_warning_s', 'Warning') +vim.api.nvim_set_var('ale_fixers', fixers) +vim.api.nvim_set_var('ale_python_mypy_ignore_invalid_syntax', 1) +vim.api.nvim_set_var('ale_python_mypy_executable', 'mypy') +vim.api.nvim_set_var('ale_python_mypy_options', '--config-file mypy.ini') +vim.api.nvim_set_var('g:ale_sign_error', '>>') +vim.api.nvim_set_var('ale_fix_on_save', 1) +vim.api.nvim_set_var('ale_linters_explicit', 0) diff --git a/nvim-primeagen/after/plugin/cmp.lua b/nvim-primeagen/after/plugin/cmp.lua new file mode 100644 index 0000000..a85ee9b --- /dev/null +++ b/nvim-primeagen/after/plugin/cmp.lua @@ -0,0 +1,41 @@ +local cmp = require("cmp") +local luasnip = require("luasnip") + +cmp.setup({ + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) -- For luasnip users + end, + }, + sources = { + { name = "luasnip" }, + { name = "path" }, + }, + mapping = { + ["<Tab>"] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + -- they way you will only jump inside the snippet region + -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), + + ["<S-Tab>"] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + + -- ... Your other mappings ... + }, +}) diff --git a/nvim-primeagen/after/plugin/colors.lua b/nvim-primeagen/after/plugin/colors.lua new file mode 100644 index 0000000..fe97b1b --- /dev/null +++ b/nvim-primeagen/after/plugin/colors.lua @@ -0,0 +1,14 @@ +require('rose-pine').setup({ + disable_background = true +}) + +function ColorMyPencils(color) + color = color or "rose-pine" + vim.cmd.colorscheme(color) + + vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) + vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) + +end + +ColorMyPencils() diff --git a/nvim-primeagen/after/plugin/copilot.lua b/nvim-primeagen/after/plugin/copilot.lua new file mode 100644 index 0000000..7ed6529 --- /dev/null +++ b/nvim-primeagen/after/plugin/copilot.lua @@ -0,0 +1,17 @@ +vim.g.copilot_no_tab_map = true +vim.api.nvim_set_keymap("i", "<C-J>", 'copilot#Accept("<CR>")', { silent = true, expr = true }) +-- not working vim.g.copilot_assume_mapped = true + +vim.g.copilot_filetypes = { + ["*"] = false, + ["markdown"] = false, + ["javascript"] = false, + ["typescript"] = false, + ["lua"] = true, + ["rust"] = true, + ["c"] = true, + ["c#"] = true, + ["c++"] = true, + ["go"] = true, + ["python"] = true, +} diff --git a/nvim-primeagen/after/plugin/dap.lua b/nvim-primeagen/after/plugin/dap.lua new file mode 100644 index 0000000..fcfb94a --- /dev/null +++ b/nvim-primeagen/after/plugin/dap.lua @@ -0,0 +1,41 @@ +local dap = require('dap') +dap.adapters.python = { + type = 'executable'; + command = '.venv/bin/python'; + args = { '-m', 'debugpy.adapter' }; +} +dap.configurations.python = { + { + type = 'python'; + request = 'launch'; + name = "Launch file"; + program = "${file}"; + pythonPath = function() + return '.venv/bin/python' + end; + }, +} + +vim.keymap.set('n', '<F5>', function() require('dap').continue() end) +vim.keymap.set('n', '<F10>', function() require('dap').step_over() end) +vim.keymap.set('n', '<F11>', function() require('dap').step_into() end) +vim.keymap.set('n', '<F12>', function() require('dap').step_out() end) +vim.keymap.set('n', '<F9>', function() require('dap').toggle_breakpoint() end) +vim.keymap.set('n', '<Leader>B', function() require('dap').set_breakpoint() end) +vim.keymap.set('n', '<Leader>lp', function() require('dap').set_breakpoint(nil, nil, vim.fn.input('Log point message: ')) end) +vim.keymap.set('n', '<Leader>dr', function() require('dap').repl.open() end) +vim.keymap.set('n', '<Leader>dl', function() require('dap').run_last() end) +vim.keymap.set({'n', 'v'}, '<Leader>dh', function() + require('dap.ui.widgets').hover() +end) +vim.keymap.set({'n', 'v'}, '<Leader>dp', function() + require('dap.ui.widgets').preview() +end) +vim.keymap.set('n', '<Leader>df', function() + local widgets = require('dap.ui.widgets') + widgets.centered_float(widgets.frames) +end) +vim.keymap.set('n', '<Leader>ds', function() + local widgets = require('dap.ui.widgets') + widgets.centered_float(widgets.scopes) +end) diff --git a/nvim-primeagen/after/plugin/fugitive.lua b/nvim-primeagen/after/plugin/fugitive.lua new file mode 100644 index 0000000..80c9070 --- /dev/null +++ b/nvim-primeagen/after/plugin/fugitive.lua @@ -0,0 +1 @@ +vim.keymap.set("n", "<leader>gs", vim.cmd.Git) diff --git a/nvim-primeagen/after/plugin/harpoon.lua b/nvim-primeagen/after/plugin/harpoon.lua new file mode 100644 index 0000000..4f57af5 --- /dev/null +++ b/nvim-primeagen/after/plugin/harpoon.lua @@ -0,0 +1,10 @@ +local mark = require("harpoon.mark") +local ui = require("harpoon.ui") + +vim.keymap.set("n", "<leader>a", mark.add_file) +vim.keymap.set("n", "<leader>bh", ui.toggle_quick_menu) + +vim.keymap.set("n", "<C-h>", function() ui.nav_file(1) end) +vim.keymap.set("n", "<C-t>", function() ui.nav_file(2) end) +vim.keymap.set("n", "<C-n>", function() ui.nav_file(3) end) +vim.keymap.set("n", "<C-s>", function() ui.nav_file(4) end) diff --git a/nvim-primeagen/after/plugin/ledger.lua b/nvim-primeagen/after/plugin/ledger.lua new file mode 100644 index 0000000..6a47935 --- /dev/null +++ b/nvim-primeagen/after/plugin/ledger.lua @@ -0,0 +1,4 @@ +-- easily make a transaction starred with <leader>- +vim.keymap.set("n", "<leader>-", "<cmd>call ledger#transaction_state_set(line('.'), '*')<CR>") + +vim.api.nvim_set_var("ledger_detailed_first", 0) diff --git a/nvim-primeagen/after/plugin/lsp.lua b/nvim-primeagen/after/plugin/lsp.lua new file mode 100644 index 0000000..e6e2bda --- /dev/null +++ b/nvim-primeagen/after/plugin/lsp.lua @@ -0,0 +1,99 @@ +local lsp = require("lsp-zero") + +lsp.preset("recommended") + +lsp.ensure_installed({ + 'pyright', 'lua_ls' +}) + +-- Fix Undefined global 'vim' +lsp.configure('lua_ls', { + settings = { + Lua = { + diagnostics = { + globals = { 'vim' } + } + } + } +}) + + +-- local cmp = require('cmp') +-- local cmp_select = {behavior = cmp.SelectBehavior.Select} +-- local cmp_mappings = lsp.defaults.cmp_mappings({ +-- ['<C-p>'] = cmp.mapping.select_prev_item(cmp_select), +-- ['<C-n>'] = cmp.mapping.select_next_item(cmp_select), +-- ['<C-y>'] = cmp.mapping.confirm({ select = true }), +-- ["<C-Space>"] = cmp.mapping.complete(), +-- }) + +-- cmp_mappings['<Tab>'] = nil +-- cmp_mappings['<S-Tab>'] = nil + +lsp.setup_nvim_cmp({ + mapping = cmp_mappings +}) + + +lsp.set_preferences({ + suggest_lsp_servers = false, + sign_icons = { + error = 'E', + warn = 'W', + hint = 'H', + info = 'I' + } +}) + +lsp.on_attach(function(client, bufnr) + local opts = {buffer = bufnr, remap = false} + + vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) + vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) + vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts) + vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts) + vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts) + vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) + vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts) + vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts) + vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts) + vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts) +end) + +lsp.skip_server_setup({ + 'pylsp', +}) + +lsp.setup() + +vim.diagnostic.config({ + virtual_text = true +}) + +-- rnix config + +local lspconfig = require'lspconfig' +lspconfig.nil_ls.setup{ + autostart = true, + capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities()), + cmd = vim.env.NIL_LSP_PATH, + settings = { + rootMarkers = {".git/"}, + languages = { + nix = { + formatters = { + { + exe = "nixpkgs-fmt", + args = {} + } + }, + linters = { + { + exe = "nil_lsp", + args = {} + } + } + } + } + } +} diff --git a/nvim-primeagen/after/plugin/luasnip.lua b/nvim-primeagen/after/plugin/luasnip.lua new file mode 100644 index 0000000..7f6bbde --- /dev/null +++ b/nvim-primeagen/after/plugin/luasnip.lua @@ -0,0 +1,26 @@ +local has_words_before = function() + unpack = unpack or table.unpack + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil +end + + +local ls = require("luasnip") + +ls.filetype_extend("htmldjango", {"html"}) + +require("luasnip.loaders.from_lua").lazy_load({ paths = "~/.config/nvim/snippets" }) +require("luasnip.loaders.from_vscode").lazy_load() + +ls.config.set_config({ + history = true, + updateevents = "TextChanged, TextChangedI", --update changes as you type + enable_autosnippets = true, + ext_opts = { + [require("luasnip.util.types").choiceNode] = { + active = { + virt_text = { { ">" } }, + }, + }, + }, +}) diff --git a/nvim-primeagen/after/plugin/marksman.lua b/nvim-primeagen/after/plugin/marksman.lua new file mode 100644 index 0000000..63865ef --- /dev/null +++ b/nvim-primeagen/after/plugin/marksman.lua @@ -0,0 +1 @@ +require'lspconfig'.marksman.setup{} diff --git a/nvim-primeagen/after/plugin/neotest-python.lua b/nvim-primeagen/after/plugin/neotest-python.lua new file mode 100644 index 0000000..6505eec --- /dev/null +++ b/nvim-primeagen/after/plugin/neotest-python.lua @@ -0,0 +1,116 @@ +require("neotest").setup({ + quickfix = { + open = true, + enabled = true, + }, + status = { + enabled = true, + signs = true, -- Sign after function signature + virtual_text = false + }, + icons = { + child_indent = "│", + child_prefix = "├", + collapsed = "─", + expanded = "╮", + failed = "✘", + final_child_indent = " ", + final_child_prefix = "╰", + non_collapsible = "─", + passed = "✓", + running = "", + running_animated = { "/", "|", "\\", "-", "/", "|", "\\", "-" }, + skipped = "↓", + unknown = "" + }, + floating = { + border = "rounded", + max_height = 0.9, + max_width = 0.9, + options = {} + }, + summary = { + open = "botright vsplit | vertical resize 60" + }, + highlights = { + adapter_name = "NeotestAdapterName", + border = "NeotestBorder", + dir = "NeotestDir", + expand_marker = "NeotestExpandMarker", + failed = "NeotestFailed", + file = "NeotestFile", + focused = "NeotestFocused", + indent = "NeotestIndent", + marked = "NeotestMarked", + namespace = "NeotestNamespace", + passed = "NeotestPassed", + running = "NeotestRunning", + select_win = "NeotestWinSelect", + skipped = "NeotestSkipped", + target = "NeotestTarget", + test = "NeotestTest", + unknown = "NeotestUnknown" + }, + adapters = { + require("neotest-python")({ + -- Extra arguments for nvim-dap configuration + -- See https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for values + dap = { justMyCode = false }, + -- Command line arguments for runner + -- Can also be a function to return dynamic values + args = {"--log-level", "DEBUG"}, + -- Runner to use. Will use pytest if available by default. + -- Can be a function to return dynamic value. + runner = "pytest", + -- Custom python path for the runner. + -- Can be a string or a list of strings. + -- Can also be a function to return dynamic value. + -- If not provided, the path will be inferred by checking for + -- virtual envs in the local directory and for Pipenev/Poetry configs + python = ".venv/bin/python", + -- Returns if a given file path is a test file. + -- NB: This function is called a lot so don't perform any heavy tasks within it. + }) + }, +}) + +require("neodev").setup({ + library = { plugins = { "neotest" }, types = true }, + ... +}) + +vim.keymap.set("n", "tn", function() + require("neotest").run.run() +end) + +vim.keymap.set("n", "tf", function() + require("neotest").run.run(vim.fn.expand("%")) +end) + +vim.keymap.set("n", "td", function() + require("neotest").run.run({strategy = "dap"}) +end) + +vim.keymap.set("n", "tr", function() + local neotest = require("neotest") + neotest.run.run() + neotest.summary.open() +end, +{ noremap = true, silent = true, nowait = true }) + +vim.keymap.set("n", "ta", function() + local neotest = require("neotest") + neotest.run.attach() +end) + +vim.keymap.set("n", "to", function() + local neotest = require("neotest") + neotest.output.open({ last_run = true, enter = true }) +end, +{ noremap = true, silent = true, nowait = true }) + +vim.keymap.set("n", "tt", function() + local neotest = require("neotest") + neotest.summary.toggle() +end, +{ noremap = true, silent = true, nowait = true }) diff --git a/nvim-primeagen/after/plugin/telescope.lua b/nvim-primeagen/after/plugin/telescope.lua new file mode 100644 index 0000000..d11622b --- /dev/null +++ b/nvim-primeagen/after/plugin/telescope.lua @@ -0,0 +1,17 @@ +local builtin = require('telescope.builtin') +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, {}) +vim.keymap.set('n', '<leader>fs', builtin.grep_string, {}) +vim.keymap.set('n', '<leader>fc', builtin.command_history, {}) +vim.keymap.set('n', '<leader>fk', builtin.keymaps, {}) +vim.keymap.set('n', '<leader>fl', builtin.diagnostics, {}) +vim.keymap.set('n', '<leader>fo', builtin.builtin, {}) +vim.keymap.set('n', '<leader>f-', builtin.oldfiles, {}) + +vim.keymap.set('n', '<leader>ps', function() + builtin.grep_string({ search = vim.fn.input("Grep > ") }) +end) + +require("telescope").load_extension("emoji") diff --git a/nvim-primeagen/after/plugin/todo-txt.lua b/nvim-primeagen/after/plugin/todo-txt.lua new file mode 100644 index 0000000..09be576 --- /dev/null +++ b/nvim-primeagen/after/plugin/todo-txt.lua @@ -0,0 +1,44 @@ +require('todotxt-nvim').setup({ + todo_file = "/home/lemon/Documents/Notes/todo/todo.txt", + capture = { + alternative_priority = { + A = "today", + B = "tomorrow", + C = "this week", + D = "next week", + E = "next month", + }, + }, + highlights = { + priorities = { + A = { + fg = "yellow", + bg = "NONE", + style = "bold", + }, + B = { + fg = "green", + bg = "NONE", + style = "bold", + }, + C = { + fg = "cyan", + bg = "NONE", + style = "bold", + }, + D = { + fg = "magenta", + bg = "NONE", + style = "bold", + }, + }, + }, + sidebar = { + width = 70, + position = "right", -- default: "right" + }, +}) + +-- Keyboard shortcuts for todotxt-nvim. +vim.keymap.set("n", "<localleader>tp", "<cmd>ToDoTxtTasksToggle<CR>") +vim.keymap.set("n", "<localleader>ta", "<cmd>ToDoTxtCapture<CR>") diff --git a/nvim-primeagen/after/plugin/treesitter.lua b/nvim-primeagen/after/plugin/treesitter.lua new file mode 100644 index 0000000..3a7c091 --- /dev/null +++ b/nvim-primeagen/after/plugin/treesitter.lua @@ -0,0 +1,23 @@ +require'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" + ensure_installed = { "python", "bash", "javascript", "typescript", "c", "go", "css", "html", "htmldjango", "lua", "rust" }, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, + + highlight = { + -- `false` will disable the whole extension + enable = true, + + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false, + }, +} + diff --git a/nvim-primeagen/after/plugin/trouble.lua b/nvim-primeagen/after/plugin/trouble.lua new file mode 100644 index 0000000..cf1256a --- /dev/null +++ b/nvim-primeagen/after/plugin/trouble.lua @@ -0,0 +1,3 @@ +vim.keymap.set("n", "<leader>xq", "<cmd>TroubleToggle quickfix<cr>", + {silent = true, noremap = true} +) diff --git a/nvim-primeagen/after/plugin/undotree.lua b/nvim-primeagen/after/plugin/undotree.lua new file mode 100644 index 0000000..97bb7ab --- /dev/null +++ b/nvim-primeagen/after/plugin/undotree.lua @@ -0,0 +1,2 @@ +vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle) + diff --git a/nvim-primeagen/after/plugin/zenmode.lua b/nvim-primeagen/after/plugin/zenmode.lua new file mode 100644 index 0000000..753fbf8 --- /dev/null +++ b/nvim-primeagen/after/plugin/zenmode.lua @@ -0,0 +1,30 @@ + +vim.keymap.set("n", "<leader>zz", function() + require("zen-mode").setup { + window = { + width = 90, + options = { } + }, + } + require("zen-mode").toggle() + vim.wo.wrap = false + vim.wo.number = true + vim.wo.rnu = true + ColorMyPencils() +end) + + +vim.keymap.set("n", "<leader>zZ", function() + require("zen-mode").setup { + window = { + width = 80, + options = { } + }, + } + require("zen-mode").toggle() + vim.wo.wrap = false + vim.wo.number = false + vim.wo.rnu = false + vim.opt.colorcolumn = "0" + ColorMyPencils() +end) diff --git a/nvim-primeagen/init.lua b/nvim-primeagen/init.lua new file mode 100644 index 0000000..de6b0d9 --- /dev/null +++ b/nvim-primeagen/init.lua @@ -0,0 +1 @@ +require("lemon") diff --git a/nvim-primeagen/lua/lemon/init.lua b/nvim-primeagen/lua/lemon/init.lua new file mode 100644 index 0000000..e2266b2 --- /dev/null +++ b/nvim-primeagen/lua/lemon/init.lua @@ -0,0 +1,7 @@ +require("lemon.set") +require("lemon.remap") +require("lemon.packer") + +vim.g.netrw_browse_split = 0 +vim.g.netrw_banner = 0 +vim.g.netrw_winsize = 25 diff --git a/nvim-primeagen/lua/lemon/packer.lua b/nvim-primeagen/lua/lemon/packer.lua new file mode 100644 index 0000000..83da426 --- /dev/null +++ b/nvim-primeagen/lua/lemon/packer.lua @@ -0,0 +1,108 @@ +-- This file can be loaded by calling `lua require('plugins')` from your init.vim + +-- Only required if you have packer configured as `opt` +--vim.cmd.packadd('packer.nvim') + +local ensure_packer = function() + local fn = vim.fn + local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' + if fn.empty(fn.glob(install_path)) > 0 then + fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) + vim.cmd [[packadd packer.nvim]] + return true + end + return false +end + +local packer_bootstrap = ensure_packer() + +return require('packer').startup(function(use) + -- Packer can manage itself + use 'wbthomason/packer.nvim' + use 'dense-analysis/ale' + use { + 'arnarg/todotxt.nvim', + requires = {'MunifTanjim/nui.nvim'}, + } + use("theprimeagen/harpoon") + use { + 'nvim-telescope/telescope.nvim', tag = '0.1.0', + -- or , branch = '0.1.x', + requires = { {'nvim-lua/plenary.nvim'} } + } + use('xiyaowong/telescope-emoji.nvim') + + use({ + 'rose-pine/neovim', + as = 'rose-pine', + config = function() + vim.cmd('colorscheme rose-pine') + end + }) + + use({ + "folke/trouble.nvim", + config = function() + require("trouble").setup { + icons = false, + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + } + end + }) + + + use({"nvim-treesitter/nvim-treesitter", run = ":TSUpdate"}) + use("nvim-treesitter/playground") + use("mbbill/undotree") + use("ledger/vim-ledger") + use("tpope/vim-fugitive") + use("tpope/vim-commentary") + use("nvim-treesitter/nvim-treesitter-context"); + use('mfussenegger/nvim-dap') + + use { + 'VonHeikemen/lsp-zero.nvim', + branch = 'v1.x', + requires = { + -- LSP Support + {'neovim/nvim-lspconfig'}, + {'williamboman/mason.nvim'}, + {'williamboman/mason-lspconfig.nvim'}, + + -- Autocompletion + {'hrsh7th/nvim-cmp'}, + {'hrsh7th/cmp-buffer'}, + {'hrsh7th/cmp-path'}, + {'hrsh7th/cmp-cmdline'}, + {'saadparwaiz1/cmp_luasnip'}, + {'hrsh7th/cmp-nvim-lsp'}, + {'hrsh7th/cmp-nvim-lua'}, + + -- Snippets + {'L3MON4D3/LuaSnip'}, + {'rafamadriz/friendly-snippets'}, + } + } + + use("folke/zen-mode.nvim") + -- use("github/copilot.vim") + use("eandrju/cellular-automaton.nvim") + -- use("laytan/cloak.nvim") + use("jlanzarotta/bufexplorer") + use("mhinz/vim-signify") + use { + "nvim-neotest/neotest", + requires = { + "nvim-neotest/neotest-python", + "nvim-neotest/neotest-plenary", + "folke/neodev.nvim", + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + "antoinemadec/FixCursorHold.nvim" + } + } + +end) + diff --git a/nvim-primeagen/lua/lemon/popup.lua b/nvim-primeagen/lua/lemon/popup.lua new file mode 100644 index 0000000..b070603 --- /dev/null +++ b/nvim-primeagen/lua/lemon/popup.lua @@ -0,0 +1,58 @@ +-- Lemon_win_id = nil +-- Lemon_bufh = nil + +-- local function close_menu(force_save) +-- force_save = force_save or false + +-- vim.api.nvim_win_close(Lemon_win_id, true) + +-- Lemon_win_id = nil +-- Lemon_bufh = nil +-- end + +-- local function create_window() +-- local popup = require("plenary.popup") +-- local height = 10 +-- local width = 60 +-- local borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" } +-- local bufnr = vim.api.nvim_create_buf(false, true) +-- local Lemon_id, win = popup.create(bufnr, { +-- title = "Mesmeric!", +-- line = math.floor(((vim.o.lines - height) / 2) -1), +-- col = math.floor((vim.o.columns - width) / 2), +-- minwidth = width, +-- mineheight = height, +-- borderchars = borderchars, +-- }) +-- return { +-- bufnr = bufnr, +-- win_id = Lemon_win_id +-- } +-- end + +-- create_window() + +-- Create a new buffer and set its lines to the contents of myfile.txt +local buf = vim.api.nvim_create_buf(false, true) +local file = io.open('/home/lemon/Documents/Notes/Archive/Dr Haugh.md', 'r') +local height = 10 +local width = 60 +local lines = {} +for line in file:lines() do + table.insert(lines, line) +end +file:close() +vim.api.nvim_buf_set_lines(buf, 0, -1, true, lines) + +-- Create a new window and set its options to create a floating buffer +local win = vim.api.nvim_open_win(buf, true, { + relative='editor', + width=80, + title = "test title", + title_pos = "center", + height=10, + row=10, + col=10, + border={"╭", "─", "╮", "│", "╯", "─", "╰", "│" }, +}) + diff --git a/nvim-primeagen/lua/lemon/remap.lua b/nvim-primeagen/lua/lemon/remap.lua new file mode 100644 index 0000000..0d2f247 --- /dev/null +++ b/nvim-primeagen/lua/lemon/remap.lua @@ -0,0 +1,45 @@ +-- ThePrimeagent's stuff +vim.g.mapleader = " " +vim.keymap.set("n", "<leader>pv", vim.cmd.Ex) + +vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv") +vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv") + +vim.keymap.set("n", "J", "mzJ`z") +vim.keymap.set("n", "<C-d>", "<C-d>zz") +vim.keymap.set("n", "<C-u>", "<C-u>zz") +vim.keymap.set("n", "n", "nzzzv") +vim.keymap.set("n", "N", "Nzzzv") + +-- greatest remap ever +vim.keymap.set("x", "<leader>p", [["_dP]]) + +-- next greatest remap ever : asbjornHaland +vim.keymap.set({"n", "v"}, "<leader>y", [["+y]]) +vim.keymap.set("n", "<leader>Y", [["+Y]]) + +vim.keymap.set({"n", "v"}, "<leader>d", [["_d]]) + +-- This is going to get me cancelled +vim.keymap.set("i", "<C-c>", "<Esc>") + +vim.keymap.set("n", "Q", "<nop>") +--vim.keymap.set("n", "<C-f>", "<cmd>silent !tmux neww tmux-sessionizer<CR>") +-- vim.keymap.set("n", "<leader>f", vim.lsp.buf.format) + +vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz") +vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz") +vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz") +vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz") + +vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]]) +vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true }) + +vim.keymap.set("n", "<leader>ev", "<cmd>e ~/dotfiles/nvim/lua/lemon/packer.lua<CR>"); +vim.keymap.set("n", "<leader>mr", "<cmd>CellularAutomaton make_it_rain<CR>"); + +vim.keymap.set("n", "<leader><leader>", function() + vim.cmd("so") +end) +-- end ThePrimeagent's stuff + diff --git a/nvim-primeagen/lua/lemon/set.lua b/nvim-primeagen/lua/lemon/set.lua new file mode 100644 index 0000000..3c662a9 --- /dev/null +++ b/nvim-primeagen/lua/lemon/set.lua @@ -0,0 +1,44 @@ +vim.opt.guicursor = "" + +vim.opt.nu = true +vim.opt.relativenumber = true + +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true +vim.opt.autoindent = true + +vim.opt.smartindent = true + +vim.opt.wrap = false + +vim.opt.swapfile = false +vim.opt.backup = false +vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" +vim.opt.undofile = true + +vim.opt.hlsearch = false +vim.opt.incsearch = true + +vim.opt.termguicolors = true + +vim.opt.scrolloff = 8 +vim.opt.signcolumn = "yes" +vim.opt.isfname:append("@-@") + +vim.opt.updatetime = 50 + +vim.opt.colorcolumn = "" + +-- end ThePrimeagen stuff + +vim.opt.wildmenu = true +vim.opt.showmatch = true +vim.opt.splitbelow = true +vim.opt.splitright = true +vim.opt.hidden = true +vim.opt.path = "+=**" +vim.opt.more = true +vim.opt.equalalways = true +vim.opt.listchars="tab:»→,trail:␣" |