Moved lazy nvim to separate directory
authorLukas Krickl <lukas@krickl.dev>
Fri, 17 Nov 2023 07:46:25 +0000 (08:46 +0100)
committerLukas Krickl <lukas@krickl.dev>
Fri, 17 Nov 2023 07:46:25 +0000 (08:46 +0100)
46 files changed:
nvim/init.lua [deleted file]
nvim/init.vim [new file with mode: 0644]
nvim/lua/.luarc.json [deleted file]
nvim/lua/main/init.lua [deleted file]
nvim/lua/main/lazy.lua [deleted file]
nvim/lua/main/remaps.lua [deleted file]
nvim/lua/plugin/fugitive.lua [deleted file]
nvim/lua/plugin/harpoon.lua [deleted file]
nvim/lua/plugin/init.lua [deleted file]
nvim/lua/plugin/lspzero.lua [deleted file]
nvim/lua/plugin/lualine.lua [deleted file]
nvim/lua/plugin/mason.lua [deleted file]
nvim/lua/plugin/neodev.lua [deleted file]
nvim/lua/plugin/notify.lua [deleted file]
nvim/lua/plugin/nvim-dap.lua [deleted file]
nvim/lua/plugin/persistence.lua [deleted file]
nvim/lua/plugin/telescope.lua [deleted file]
nvim/lua/plugin/todo.lua [deleted file]
nvim/lua/plugin/toggleterm.lua [deleted file]
nvim/lua/plugin/treesitter.lua [deleted file]
nvim/lua/plugin/trouble.lua [deleted file]
nvim/lua/plugin/undotree.lua [deleted file]
nvim/lua/plugin/yanky.lua [deleted file]
nvim_lazy/init.lua [new file with mode: 0644]
nvim_lazy/lua/.luarc.json [new file with mode: 0644]
nvim_lazy/lua/main/init.lua [new file with mode: 0644]
nvim_lazy/lua/main/lazy.lua [new file with mode: 0644]
nvim_lazy/lua/main/remaps.lua [new file with mode: 0644]
nvim_lazy/lua/plugin/fugitive.lua [new file with mode: 0644]
nvim_lazy/lua/plugin/harpoon.lua [new file with mode: 0644]
nvim_lazy/lua/plugin/init.lua [new file with mode: 0644]
nvim_lazy/lua/plugin/lspzero.lua [new file with mode: 0644]
nvim_lazy/lua/plugin/lualine.lua [new file with mode: 0644]
nvim_lazy/lua/plugin/mason.lua [new file with mode: 0644]
nvim_lazy/lua/plugin/neodev.lua [new file with mode: 0644]
nvim_lazy/lua/plugin/notify.lua [new file with mode: 0644]
nvim_lazy/lua/plugin/nvim-dap.lua [new file with mode: 0644]
nvim_lazy/lua/plugin/persistence.lua [new file with mode: 0644]
nvim_lazy/lua/plugin/telescope.lua [new file with mode: 0644]
nvim_lazy/lua/plugin/todo.lua [new file with mode: 0644]
nvim_lazy/lua/plugin/toggleterm.lua [new file with mode: 0644]
nvim_lazy/lua/plugin/treesitter.lua [new file with mode: 0644]
nvim_lazy/lua/plugin/trouble.lua [new file with mode: 0644]
nvim_lazy/lua/plugin/undotree.lua [new file with mode: 0644]
nvim_lazy/lua/plugin/yanky.lua [new file with mode: 0644]
vim/init.vim [deleted file]

diff --git a/nvim/init.lua b/nvim/init.lua
deleted file mode 100644 (file)
index 9fb386c..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-require("main")
-require("plugin")
diff --git a/nvim/init.vim b/nvim/init.vim
new file mode 100644 (file)
index 0000000..d5131dd
--- /dev/null
@@ -0,0 +1,37 @@
+" keymaps 
+
+let mapleader = " "
+nnoremap <leader>ff :Ex<CR>
+nnoremap <leader>fc :!make format
+nnoremap <leader>fv :!make lint
+nnoremap <leader>ft :!make tags<CR><CR>
+nnoremap <leader>fx :!make
+
+" ctags 
+" tag next 
+nnoremap <leader>tn :tn<CR>
+" tag prev
+nnoremap <leader>tp :tp<CR>
+" tag search 
+nnoremap <leader>ts :ts 
+" go to def 
+nnoremap <leader>td <C-]> 
+" return from def 
+nnoremap <leader>tr <C-t> 
+
+
+" settings 
+set termguicolors
+set number
+set relativenumber 
+set clipboard=unnamedplus
+
+set expandtab
+set smartindent
+set tabstop=2
+set shiftwidth=2
+
+set incsearch
+
+set autoread
+set updatetime=50
diff --git a/nvim/lua/.luarc.json b/nvim/lua/.luarc.json
deleted file mode 100644 (file)
index 23b9ee2..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-    "workspace.checkThirdParty": false
-}
\ No newline at end of file
diff --git a/nvim/lua/main/init.lua b/nvim/lua/main/init.lua
deleted file mode 100644 (file)
index 9247ee1..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-require("main.lazy")
-require("main.remaps")
-
-vim.opt.termguicolors = true
-vim.cmd [[colorscheme tokyonight]]
-vim.wo.number = true
-vim.wo.relativenumber = true
-vim.opt.clipboard = 'unnamedplus'
-
-vim.o.expandtab = true
-vim.o.smartindent = true
-vim.o.tabstop = 2
-vim.o.shiftwidth = 2
-
-vim.opt.hlsearch = false
-vim.opt.incsearch = true
-
-vim.o.autoread = true
-vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "CursorHoldI", "FocusGained" }, {
-  command = "if mode() != 'c' | checktime | endif",
-  pattern = { "*" },
-})
-
-vim.opt.updatetime = 50
-
-vim.opt.signcolumn = "yes"
--- vim.opt.colorcolumn = "80"
-
-vim.opt.spelllang = 'en_us'
-vim.opt.spell = false
diff --git a/nvim/lua/main/lazy.lua b/nvim/lua/main/lazy.lua
deleted file mode 100644 (file)
index 891a560..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
-if not vim.loop.fs_stat(lazypath) then
-  vim.fn.system({
-    "git",
-    "clone",
-    "--filter=blob:none",
-    "https://github.com/folke/lazy.nvim.git",
-    "--branch=stable", -- latest stable release
-    lazypath,
-  })
-end
-vim.opt.rtp:prepend(lazypath)
-
-plugins = {
-  {
-    'nvim-telescope/telescope.nvim',
-    dependencies = { 'nvim-lua/plenary.nvim' },
-    lazy = false
-  },
-  {
-    "nvim-treesitter/nvim-treesitter",
-    build = ":TSUpdate",
-    lazy = false
-  },
-  {
-    "folke/tokyonight.nvim",
-    lazy = false,
-    priority = 1000,
-    opts = {},
-  },
-  {
-    "nvim-lua/plenary.nvim",
-    lazy = false
-  },
-  {
-    "ThePrimeagen/harpoon",
-    lazy = false
-  },
-  { 'akinsho/toggleterm.nvim', version = "*", config = true, lazy = false },
-  { "gbprod/yanky.nvim",       lazy = false },
-  { "mbbill/undotree",         lazy = false },
-  { "tpope/vim-fugitive",      lazy = false },
-  {
-    "folke/todo-comments.nvim",
-    dependencies = { "nvim-lua/plenary.nvim" },
-    opts = {},
-    lazy = false
-  },
-  {
-    "folke/trouble.nvim",
-    dependencies = { "nvim-tree/nvim-web-devicons" },
-    lazy = false
-  },
-  { "rcarriga/nvim-notify", lazy = false },
-  {
-    'VonHeikemen/lsp-zero.nvim',
-    branch = 'v2.x',
-    dependencies = {
-      -- LSP Support
-      { 'neovim/nvim-lspconfig' }, -- Required
-      {                            -- Optional
-        'williamboman/mason.nvim',
-        build = function()
-          pcall(vim.api.nvim_command, 'MasonUpdate')
-        end,
-      },
-      { 'williamboman/mason-lspconfig.nvim' }, -- Optional
-
-      -- Autocompletion
-      { 'hrsh7th/nvim-cmp' },     -- Required
-      { 'hrsh7th/cmp-nvim-lsp' }, -- Required
-      { 'L3MON4D3/LuaSnip' },     -- Required
-    },
-
-  },
-  {
-    'nvim-lualine/lualine.nvim',
-    requires = { 'nvim-tree/nvim-web-devicons', opt = true }
-  },
-  {
-    "folke/persistence.nvim",
-    event = "BufReadPre", -- this will only start session saving when an actual file was opened
-    opts = {
-    }
-  },
-  { "folke/neodev.nvim",    opts = {} },
-  { "mfussenegger/nvim-dap" },
-  { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap" } }
-}
-
-require("lazy").setup(plugins)
diff --git a/nvim/lua/main/remaps.lua b/nvim/lua/main/remaps.lua
deleted file mode 100644 (file)
index bbf6ca2..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-vim.g.mapleader = " "
-vim.keymap.set("n", "<leader>fv", vim.cmd.Ex)
diff --git a/nvim/lua/plugin/fugitive.lua b/nvim/lua/plugin/fugitive.lua
deleted file mode 100644 (file)
index d3855f3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-vim.keymap.set("n", "<leader>gs", vim.cmd.Git) 
diff --git a/nvim/lua/plugin/harpoon.lua b/nvim/lua/plugin/harpoon.lua
deleted file mode 100644 (file)
index 204b04a..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-local mark = require("harpoon.mark")
-local ui = require("harpoon.ui")
-
-vim.keymap.set("n", "<leader>ha", mark.add_file)
-vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
-
-vim.keymap.set("n", "<leader>hn", function() ui.nav_next() end)
-vim.keymap.set("n", "<leader>hp", function() ui.nav_prev() end)
diff --git a/nvim/lua/plugin/init.lua b/nvim/lua/plugin/init.lua
deleted file mode 100644 (file)
index 0fdb08f..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-require("plugin.telescope")
-require("plugin.treesitter")
-require("plugin.harpoon")
-require("plugin.toggleterm")
-require("plugin.yanky")
-require("plugin.undotree")
-require("plugin.fugitive")
-require("plugin.todo")
-require("plugin.trouble")
-require("plugin.notify")
-require("plugin.mason")
-require("plugin.lspzero")
-require("plugin.lualine")
-require("plugin.persistence")
-require("plugin.neodev")
-require("plugin.nvim-dap")
diff --git a/nvim/lua/plugin/lspzero.lua b/nvim/lua/plugin/lspzero.lua
deleted file mode 100644 (file)
index d80151d..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-local lsp = require('lsp-zero').preset(
-  {
-    float_border = 'rounded',
-    call_servers = 'local',
-    configure_diagnostics = true,
-    setup_servers_on_start = true,
-    set_lsp_keymaps = false,
-    manage_nvim_cmp = {
-      set_sources = 'lsp',
-      set_basic_mappings = true,
-      set_extra_mappings = true,
-      use_luasnip = true,
-      set_format = true,
-      documentation_window = true,
-    }
-  }
-)
-
-lsp.on_attach(function(client, bufnr)
-  -- see :help lsp-zero-keybindings
-  -- to learn the available actions
-  lsp.default_keymaps({ buffer = bufnr })
-
-  -- autocmd format on save
-  -- vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]]
-  vim.keymap.set('n', 'gp',
-    vim.lsp.buf.format, { buffer = true })
-
-  vim.api.nvim_create_user_command("W",
-    function()
-      vim.lsp.buf.format()
-      vim.cmd('w')
-    end, { nargs = 0, desc = 'Write and format' })
-end)
-
-
-lsp.setup()
diff --git a/nvim/lua/plugin/lualine.lua b/nvim/lua/plugin/lualine.lua
deleted file mode 100644 (file)
index 90e6db2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-require('lualine').setup()
diff --git a/nvim/lua/plugin/mason.lua b/nvim/lua/plugin/mason.lua
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/nvim/lua/plugin/neodev.lua b/nvim/lua/plugin/neodev.lua
deleted file mode 100644 (file)
index f256a07..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
--- IMPORTANT: make sure to setup neodev BEFORE lspconfig
-require("neodev").setup({
-  -- add any options here, or leave empty to use the default settings
-})
diff --git a/nvim/lua/plugin/notify.lua b/nvim/lua/plugin/notify.lua
deleted file mode 100644 (file)
index 8996ae5..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-vim.notify = require("notify")
--- require("telescope").load_extension("notify")
--- require('telescope').extensions.notify.notify({})
diff --git a/nvim/lua/plugin/nvim-dap.lua b/nvim/lua/plugin/nvim-dap.lua
deleted file mode 100644 (file)
index 7167370..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-require("dapui").setup()
-
-local path = vim.fn.stdpath('data')
-
-local dap = require('dap')
-
-dap.adapters.lldb = {
-  type = 'executable',
-  command = '/usr/bin/lldb-vscode', -- adjust as needed, must be absolute path
-  name = 'lldb'
-}
-
-dap.adapters.codelldb = {
-  type = 'server',
-  port = "${port}",
-  executable = {
-    -- CHANGE THIS to your path!
-    command = path .. '/mason/bin/codelldb',
-    args = { "--port", "${port}" },
-
-    -- On windows you may have to uncomment this:
-    -- detached = false,
-  }
-}
-
-dap.configurations.cpp = {
-  {
-    name = 'Launch',
-    type = 'codelldb',
-    request = 'launch',
-    program = function()
-      return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
-    end,
-    cwd = '${workspaceFolder}',
-    stopOnEntry = false,
-    args = {},
-
-    -- ðŸ’€
-    -- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
-    --
-    --    echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
-    --
-    -- Otherwise you might get the following error:
-    --
-    --    Error on launch: Failed to attach to the target process
-    --
-    -- But you should be aware of the implications:
-    -- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
-    -- runInTerminal = false,
-  },
-}
-
--- If you want to use this for Rust and C, add something like this:
-dap.configurations.c = dap.configurations.cpp
-dap.configurations.rust = dap.configurations.cpp
-
-vim.api.nvim_create_user_command('Break', function() require('dap').toggle_breakpoint() end, {})
-vim.api.nvim_create_user_command('Cont', function() require('dap').continue() end, {})
-vim.api.nvim_create_user_command('StepIn', function() require('dap').step_into() end, {})
-vim.api.nvim_create_user_command('DapReplOpen', function() require('dap').repl.open() end, {})
-vim.api.nvim_create_user_command('DapReplClose', function() require('dap').repl.close() end, {})
-
-vim.api.nvim_create_user_command('DapOpen', function() require("dapui").open() end, {})
-vim.api.nvim_create_user_command('DapClose', function() require("dapui").close() end, {})
-vim.api.nvim_create_user_command('DapToggle', function() require("dapui").toggle() 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', '<Leader>b', function() require 'dap'.toggle_breakpoint() end)
-vim.keymap.set('n', '<Leader>B', function() require 'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: ')) 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', '<leader>dh', function() require("dap.ui.widgets").hover() end, { silent = true })
diff --git a/nvim/lua/plugin/persistence.lua b/nvim/lua/plugin/persistence.lua
deleted file mode 100644 (file)
index fa55ec6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-vim.api.nvim_set_keymap("n", "<leader>qs", [[<cmd>lua require("persistence").load()<cr>]], {})
diff --git a/nvim/lua/plugin/telescope.lua b/nvim/lua/plugin/telescope.lua
deleted file mode 100644 (file)
index 21d2b60..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-local builtin = require('telescope.builtin')
-vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
-vim.keymap.set('n', '<leader>fg', builtin.git_files, {})
-vim.keymap.set('n', '<leader>fs', builtin.live_grep, {})
-vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
-
-local actions = require("telescope.actions")
-local trouble = require("trouble.providers.telescope")
-
-local telescope = require("telescope")
-
-telescope.setup {
-  defaults = {
-    mappings = {
-      i = { ["<c-t>"] = trouble.open_with_trouble },
-      n = { ["<c-t>"] = trouble.open_with_trouble },
-    },
-  },
-}
diff --git a/nvim/lua/plugin/todo.lua b/nvim/lua/plugin/todo.lua
deleted file mode 100644 (file)
index 5cd4c30..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-vim.keymap.set("n", "]t", function()
-  require("todo-comments").jump_next()
-end, { desc = "Next todo comment" })
-
-vim.keymap.set("n", "[t", function()
-  require("todo-comments").jump_prev()
-end, { desc = "Previous todo comment" })
-
--- You can also specify a list of valid jump keywords
-
-vim.keymap.set("n", "]t", function()
-  require("todo-comments").jump_next({keywords = { "ERROR", "WARNING" }})
-end, { desc = "Next error/warning todo comment" }) 
-
-vim.keymap.set("n", "<leader>td", ":TodoTelescope")
diff --git a/nvim/lua/plugin/toggleterm.lua b/nvim/lua/plugin/toggleterm.lua
deleted file mode 100644 (file)
index 476e9cd..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-require("toggleterm").setup {
-  open_mapping = [[<c-t>]],
-  insert_mappings = true,
-  termina_mappings = true,
-  direction = "float"
-}
diff --git a/nvim/lua/plugin/treesitter.lua b/nvim/lua/plugin/treesitter.lua
deleted file mode 100644 (file)
index c66f626..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-require'nvim-treesitter.configs'.setup {
-  -- A list of parser names, or "all" (the five listed parsers should always be installed)
-  ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "rust", "python", "javascript", "typescript" },
-
-  -- 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,
-
-  -- List of parsers to ignore installing (for "all")
-  ignore_install = { "javascript" },
-
-  ---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
-  -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
-
-  highlight = {
-    enable = true,
-
-    -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
-    -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
-    -- the name of the parser)
-    -- list of language that will be disabled
-    disable = { "c", "rust" },
-    -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
-    disable = function(lang, buf)
-        local max_filesize = 100 * 1024 -- 100 KB
-        local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
-        if ok and stats and stats.size > max_filesize then
-            return true
-        end
-    end,
-
-    -- 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/lua/plugin/trouble.lua b/nvim/lua/plugin/trouble.lua
deleted file mode 100644 (file)
index 7ceff42..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-vim.keymap.set("n", "<leader>xx", function() require("trouble").open() end)
-vim.keymap.set("n", "<leader>xw", function() require("trouble").open("workspace_diagnostics") end)
-vim.keymap.set("n", "<leader>xd", function() require("trouble").open("document_diagnostics") end)
-vim.keymap.set("n", "<leader>xl", function() require("trouble").open("quickfix") end)
-vim.keymap.set("n", "<leader>xq", function() require("trouble").open("loclist") end)
-vim.keymap.set("n", "gR", function() require("trouble").open("lsp_references") end)
diff --git a/nvim/lua/plugin/undotree.lua b/nvim/lua/plugin/undotree.lua
deleted file mode 100644 (file)
index b6b9276..0000000
+++ /dev/null
@@ -1 +0,0 @@
-vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
diff --git a/nvim/lua/plugin/yanky.lua b/nvim/lua/plugin/yanky.lua
deleted file mode 100644 (file)
index 9549964..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-require("yanky").setup({
-  highlight = {
-    on_put = true,
-    on_yank = true,
-    timer = 200,
-  },
-})
-require("telescope").load_extension("yank_history")
-
diff --git a/nvim_lazy/init.lua b/nvim_lazy/init.lua
new file mode 100644 (file)
index 0000000..9fb386c
--- /dev/null
@@ -0,0 +1,2 @@
+require("main")
+require("plugin")
diff --git a/nvim_lazy/lua/.luarc.json b/nvim_lazy/lua/.luarc.json
new file mode 100644 (file)
index 0000000..23b9ee2
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "workspace.checkThirdParty": false
+}
\ No newline at end of file
diff --git a/nvim_lazy/lua/main/init.lua b/nvim_lazy/lua/main/init.lua
new file mode 100644 (file)
index 0000000..9247ee1
--- /dev/null
@@ -0,0 +1,30 @@
+require("main.lazy")
+require("main.remaps")
+
+vim.opt.termguicolors = true
+vim.cmd [[colorscheme tokyonight]]
+vim.wo.number = true
+vim.wo.relativenumber = true
+vim.opt.clipboard = 'unnamedplus'
+
+vim.o.expandtab = true
+vim.o.smartindent = true
+vim.o.tabstop = 2
+vim.o.shiftwidth = 2
+
+vim.opt.hlsearch = false
+vim.opt.incsearch = true
+
+vim.o.autoread = true
+vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "CursorHoldI", "FocusGained" }, {
+  command = "if mode() != 'c' | checktime | endif",
+  pattern = { "*" },
+})
+
+vim.opt.updatetime = 50
+
+vim.opt.signcolumn = "yes"
+-- vim.opt.colorcolumn = "80"
+
+vim.opt.spelllang = 'en_us'
+vim.opt.spell = false
diff --git a/nvim_lazy/lua/main/lazy.lua b/nvim_lazy/lua/main/lazy.lua
new file mode 100644 (file)
index 0000000..891a560
--- /dev/null
@@ -0,0 +1,91 @@
+local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
+if not vim.loop.fs_stat(lazypath) then
+  vim.fn.system({
+    "git",
+    "clone",
+    "--filter=blob:none",
+    "https://github.com/folke/lazy.nvim.git",
+    "--branch=stable", -- latest stable release
+    lazypath,
+  })
+end
+vim.opt.rtp:prepend(lazypath)
+
+plugins = {
+  {
+    'nvim-telescope/telescope.nvim',
+    dependencies = { 'nvim-lua/plenary.nvim' },
+    lazy = false
+  },
+  {
+    "nvim-treesitter/nvim-treesitter",
+    build = ":TSUpdate",
+    lazy = false
+  },
+  {
+    "folke/tokyonight.nvim",
+    lazy = false,
+    priority = 1000,
+    opts = {},
+  },
+  {
+    "nvim-lua/plenary.nvim",
+    lazy = false
+  },
+  {
+    "ThePrimeagen/harpoon",
+    lazy = false
+  },
+  { 'akinsho/toggleterm.nvim', version = "*", config = true, lazy = false },
+  { "gbprod/yanky.nvim",       lazy = false },
+  { "mbbill/undotree",         lazy = false },
+  { "tpope/vim-fugitive",      lazy = false },
+  {
+    "folke/todo-comments.nvim",
+    dependencies = { "nvim-lua/plenary.nvim" },
+    opts = {},
+    lazy = false
+  },
+  {
+    "folke/trouble.nvim",
+    dependencies = { "nvim-tree/nvim-web-devicons" },
+    lazy = false
+  },
+  { "rcarriga/nvim-notify", lazy = false },
+  {
+    'VonHeikemen/lsp-zero.nvim',
+    branch = 'v2.x',
+    dependencies = {
+      -- LSP Support
+      { 'neovim/nvim-lspconfig' }, -- Required
+      {                            -- Optional
+        'williamboman/mason.nvim',
+        build = function()
+          pcall(vim.api.nvim_command, 'MasonUpdate')
+        end,
+      },
+      { 'williamboman/mason-lspconfig.nvim' }, -- Optional
+
+      -- Autocompletion
+      { 'hrsh7th/nvim-cmp' },     -- Required
+      { 'hrsh7th/cmp-nvim-lsp' }, -- Required
+      { 'L3MON4D3/LuaSnip' },     -- Required
+    },
+
+  },
+  {
+    'nvim-lualine/lualine.nvim',
+    requires = { 'nvim-tree/nvim-web-devicons', opt = true }
+  },
+  {
+    "folke/persistence.nvim",
+    event = "BufReadPre", -- this will only start session saving when an actual file was opened
+    opts = {
+    }
+  },
+  { "folke/neodev.nvim",    opts = {} },
+  { "mfussenegger/nvim-dap" },
+  { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap" } }
+}
+
+require("lazy").setup(plugins)
diff --git a/nvim_lazy/lua/main/remaps.lua b/nvim_lazy/lua/main/remaps.lua
new file mode 100644 (file)
index 0000000..bbf6ca2
--- /dev/null
@@ -0,0 +1,2 @@
+vim.g.mapleader = " "
+vim.keymap.set("n", "<leader>fv", vim.cmd.Ex)
diff --git a/nvim_lazy/lua/plugin/fugitive.lua b/nvim_lazy/lua/plugin/fugitive.lua
new file mode 100644 (file)
index 0000000..d3855f3
--- /dev/null
@@ -0,0 +1 @@
+vim.keymap.set("n", "<leader>gs", vim.cmd.Git) 
diff --git a/nvim_lazy/lua/plugin/harpoon.lua b/nvim_lazy/lua/plugin/harpoon.lua
new file mode 100644 (file)
index 0000000..204b04a
--- /dev/null
@@ -0,0 +1,8 @@
+local mark = require("harpoon.mark")
+local ui = require("harpoon.ui")
+
+vim.keymap.set("n", "<leader>ha", mark.add_file)
+vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
+
+vim.keymap.set("n", "<leader>hn", function() ui.nav_next() end)
+vim.keymap.set("n", "<leader>hp", function() ui.nav_prev() end)
diff --git a/nvim_lazy/lua/plugin/init.lua b/nvim_lazy/lua/plugin/init.lua
new file mode 100644 (file)
index 0000000..0fdb08f
--- /dev/null
@@ -0,0 +1,16 @@
+require("plugin.telescope")
+require("plugin.treesitter")
+require("plugin.harpoon")
+require("plugin.toggleterm")
+require("plugin.yanky")
+require("plugin.undotree")
+require("plugin.fugitive")
+require("plugin.todo")
+require("plugin.trouble")
+require("plugin.notify")
+require("plugin.mason")
+require("plugin.lspzero")
+require("plugin.lualine")
+require("plugin.persistence")
+require("plugin.neodev")
+require("plugin.nvim-dap")
diff --git a/nvim_lazy/lua/plugin/lspzero.lua b/nvim_lazy/lua/plugin/lspzero.lua
new file mode 100644 (file)
index 0000000..d80151d
--- /dev/null
@@ -0,0 +1,37 @@
+local lsp = require('lsp-zero').preset(
+  {
+    float_border = 'rounded',
+    call_servers = 'local',
+    configure_diagnostics = true,
+    setup_servers_on_start = true,
+    set_lsp_keymaps = false,
+    manage_nvim_cmp = {
+      set_sources = 'lsp',
+      set_basic_mappings = true,
+      set_extra_mappings = true,
+      use_luasnip = true,
+      set_format = true,
+      documentation_window = true,
+    }
+  }
+)
+
+lsp.on_attach(function(client, bufnr)
+  -- see :help lsp-zero-keybindings
+  -- to learn the available actions
+  lsp.default_keymaps({ buffer = bufnr })
+
+  -- autocmd format on save
+  -- vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]]
+  vim.keymap.set('n', 'gp',
+    vim.lsp.buf.format, { buffer = true })
+
+  vim.api.nvim_create_user_command("W",
+    function()
+      vim.lsp.buf.format()
+      vim.cmd('w')
+    end, { nargs = 0, desc = 'Write and format' })
+end)
+
+
+lsp.setup()
diff --git a/nvim_lazy/lua/plugin/lualine.lua b/nvim_lazy/lua/plugin/lualine.lua
new file mode 100644 (file)
index 0000000..90e6db2
--- /dev/null
@@ -0,0 +1 @@
+require('lualine').setup()
diff --git a/nvim_lazy/lua/plugin/mason.lua b/nvim_lazy/lua/plugin/mason.lua
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/nvim_lazy/lua/plugin/neodev.lua b/nvim_lazy/lua/plugin/neodev.lua
new file mode 100644 (file)
index 0000000..f256a07
--- /dev/null
@@ -0,0 +1,4 @@
+-- IMPORTANT: make sure to setup neodev BEFORE lspconfig
+require("neodev").setup({
+  -- add any options here, or leave empty to use the default settings
+})
diff --git a/nvim_lazy/lua/plugin/notify.lua b/nvim_lazy/lua/plugin/notify.lua
new file mode 100644 (file)
index 0000000..8996ae5
--- /dev/null
@@ -0,0 +1,3 @@
+vim.notify = require("notify")
+-- require("telescope").load_extension("notify")
+-- require('telescope').extensions.notify.notify({})
diff --git a/nvim_lazy/lua/plugin/nvim-dap.lua b/nvim_lazy/lua/plugin/nvim-dap.lua
new file mode 100644 (file)
index 0000000..7167370
--- /dev/null
@@ -0,0 +1,78 @@
+require("dapui").setup()
+
+local path = vim.fn.stdpath('data')
+
+local dap = require('dap')
+
+dap.adapters.lldb = {
+  type = 'executable',
+  command = '/usr/bin/lldb-vscode', -- adjust as needed, must be absolute path
+  name = 'lldb'
+}
+
+dap.adapters.codelldb = {
+  type = 'server',
+  port = "${port}",
+  executable = {
+    -- CHANGE THIS to your path!
+    command = path .. '/mason/bin/codelldb',
+    args = { "--port", "${port}" },
+
+    -- On windows you may have to uncomment this:
+    -- detached = false,
+  }
+}
+
+dap.configurations.cpp = {
+  {
+    name = 'Launch',
+    type = 'codelldb',
+    request = 'launch',
+    program = function()
+      return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
+    end,
+    cwd = '${workspaceFolder}',
+    stopOnEntry = false,
+    args = {},
+
+    -- ðŸ’€
+    -- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
+    --
+    --    echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
+    --
+    -- Otherwise you might get the following error:
+    --
+    --    Error on launch: Failed to attach to the target process
+    --
+    -- But you should be aware of the implications:
+    -- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
+    -- runInTerminal = false,
+  },
+}
+
+-- If you want to use this for Rust and C, add something like this:
+dap.configurations.c = dap.configurations.cpp
+dap.configurations.rust = dap.configurations.cpp
+
+vim.api.nvim_create_user_command('Break', function() require('dap').toggle_breakpoint() end, {})
+vim.api.nvim_create_user_command('Cont', function() require('dap').continue() end, {})
+vim.api.nvim_create_user_command('StepIn', function() require('dap').step_into() end, {})
+vim.api.nvim_create_user_command('DapReplOpen', function() require('dap').repl.open() end, {})
+vim.api.nvim_create_user_command('DapReplClose', function() require('dap').repl.close() end, {})
+
+vim.api.nvim_create_user_command('DapOpen', function() require("dapui").open() end, {})
+vim.api.nvim_create_user_command('DapClose', function() require("dapui").close() end, {})
+vim.api.nvim_create_user_command('DapToggle', function() require("dapui").toggle() 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', '<Leader>b', function() require 'dap'.toggle_breakpoint() end)
+vim.keymap.set('n', '<Leader>B', function() require 'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: ')) 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', '<leader>dh', function() require("dap.ui.widgets").hover() end, { silent = true })
diff --git a/nvim_lazy/lua/plugin/persistence.lua b/nvim_lazy/lua/plugin/persistence.lua
new file mode 100644 (file)
index 0000000..fa55ec6
--- /dev/null
@@ -0,0 +1 @@
+vim.api.nvim_set_keymap("n", "<leader>qs", [[<cmd>lua require("persistence").load()<cr>]], {})
diff --git a/nvim_lazy/lua/plugin/telescope.lua b/nvim_lazy/lua/plugin/telescope.lua
new file mode 100644 (file)
index 0000000..21d2b60
--- /dev/null
@@ -0,0 +1,19 @@
+local builtin = require('telescope.builtin')
+vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
+vim.keymap.set('n', '<leader>fg', builtin.git_files, {})
+vim.keymap.set('n', '<leader>fs', builtin.live_grep, {})
+vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
+
+local actions = require("telescope.actions")
+local trouble = require("trouble.providers.telescope")
+
+local telescope = require("telescope")
+
+telescope.setup {
+  defaults = {
+    mappings = {
+      i = { ["<c-t>"] = trouble.open_with_trouble },
+      n = { ["<c-t>"] = trouble.open_with_trouble },
+    },
+  },
+}
diff --git a/nvim_lazy/lua/plugin/todo.lua b/nvim_lazy/lua/plugin/todo.lua
new file mode 100644 (file)
index 0000000..5cd4c30
--- /dev/null
@@ -0,0 +1,15 @@
+vim.keymap.set("n", "]t", function()
+  require("todo-comments").jump_next()
+end, { desc = "Next todo comment" })
+
+vim.keymap.set("n", "[t", function()
+  require("todo-comments").jump_prev()
+end, { desc = "Previous todo comment" })
+
+-- You can also specify a list of valid jump keywords
+
+vim.keymap.set("n", "]t", function()
+  require("todo-comments").jump_next({keywords = { "ERROR", "WARNING" }})
+end, { desc = "Next error/warning todo comment" }) 
+
+vim.keymap.set("n", "<leader>td", ":TodoTelescope")
diff --git a/nvim_lazy/lua/plugin/toggleterm.lua b/nvim_lazy/lua/plugin/toggleterm.lua
new file mode 100644 (file)
index 0000000..476e9cd
--- /dev/null
@@ -0,0 +1,6 @@
+require("toggleterm").setup {
+  open_mapping = [[<c-t>]],
+  insert_mappings = true,
+  termina_mappings = true,
+  direction = "float"
+}
diff --git a/nvim_lazy/lua/plugin/treesitter.lua b/nvim_lazy/lua/plugin/treesitter.lua
new file mode 100644 (file)
index 0000000..c66f626
--- /dev/null
@@ -0,0 +1,41 @@
+require'nvim-treesitter.configs'.setup {
+  -- A list of parser names, or "all" (the five listed parsers should always be installed)
+  ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "rust", "python", "javascript", "typescript" },
+
+  -- 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,
+
+  -- List of parsers to ignore installing (for "all")
+  ignore_install = { "javascript" },
+
+  ---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
+  -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
+
+  highlight = {
+    enable = true,
+
+    -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
+    -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
+    -- the name of the parser)
+    -- list of language that will be disabled
+    disable = { "c", "rust" },
+    -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
+    disable = function(lang, buf)
+        local max_filesize = 100 * 1024 -- 100 KB
+        local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
+        if ok and stats and stats.size > max_filesize then
+            return true
+        end
+    end,
+
+    -- 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_lazy/lua/plugin/trouble.lua b/nvim_lazy/lua/plugin/trouble.lua
new file mode 100644 (file)
index 0000000..7ceff42
--- /dev/null
@@ -0,0 +1,6 @@
+vim.keymap.set("n", "<leader>xx", function() require("trouble").open() end)
+vim.keymap.set("n", "<leader>xw", function() require("trouble").open("workspace_diagnostics") end)
+vim.keymap.set("n", "<leader>xd", function() require("trouble").open("document_diagnostics") end)
+vim.keymap.set("n", "<leader>xl", function() require("trouble").open("quickfix") end)
+vim.keymap.set("n", "<leader>xq", function() require("trouble").open("loclist") end)
+vim.keymap.set("n", "gR", function() require("trouble").open("lsp_references") end)
diff --git a/nvim_lazy/lua/plugin/undotree.lua b/nvim_lazy/lua/plugin/undotree.lua
new file mode 100644 (file)
index 0000000..b6b9276
--- /dev/null
@@ -0,0 +1 @@
+vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
diff --git a/nvim_lazy/lua/plugin/yanky.lua b/nvim_lazy/lua/plugin/yanky.lua
new file mode 100644 (file)
index 0000000..9549964
--- /dev/null
@@ -0,0 +1,9 @@
+require("yanky").setup({
+  highlight = {
+    on_put = true,
+    on_yank = true,
+    timer = 200,
+  },
+})
+require("telescope").load_extension("yank_history")
+
diff --git a/vim/init.vim b/vim/init.vim
deleted file mode 100644 (file)
index d5131dd..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-" keymaps 
-
-let mapleader = " "
-nnoremap <leader>ff :Ex<CR>
-nnoremap <leader>fc :!make format
-nnoremap <leader>fv :!make lint
-nnoremap <leader>ft :!make tags<CR><CR>
-nnoremap <leader>fx :!make
-
-" ctags 
-" tag next 
-nnoremap <leader>tn :tn<CR>
-" tag prev
-nnoremap <leader>tp :tp<CR>
-" tag search 
-nnoremap <leader>ts :ts 
-" go to def 
-nnoremap <leader>td <C-]> 
-" return from def 
-nnoremap <leader>tr <C-t> 
-
-
-" settings 
-set termguicolors
-set number
-set relativenumber 
-set clipboard=unnamedplus
-
-set expandtab
-set smartindent
-set tabstop=2
-set shiftwidth=2
-
-set incsearch
-
-set autoread
-set updatetime=50