summaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
Diffstat (limited to '.config')
-rw-r--r--.config/nvim/after/plugin/harpoon.lua41
-rw-r--r--.config/nvim/after/plugin/lsp.lua32
-rw-r--r--.config/nvim/after/plugin/mason.lua1
-rw-r--r--.config/nvim/after/plugin/nvim-dap-lldb.lua35
-rw-r--r--.config/nvim/after/plugin/telescope.lua6
-rw-r--r--.config/nvim/after/plugin/treesitter.lua21
-rw-r--r--.config/nvim/init.lua5
-rw-r--r--.config/nvim/lua/jacob/init.lua3
-rw-r--r--.config/nvim/lua/jacob/plugins.lua69
-rw-r--r--.config/nvim/lua/jacob/remaps.lua68
-rw-r--r--.config/nvim/lua/plugins.lua42
-rw-r--r--.config/nvim/lua/remaps.lua38
-rw-r--r--.config/nvim/lua/set.lua (renamed from .config/nvim/lua/jacob/set.lua)8
13 files changed, 90 insertions, 279 deletions
diff --git a/.config/nvim/after/plugin/harpoon.lua b/.config/nvim/after/plugin/harpoon.lua
deleted file mode 100644
index 08b092a..0000000
--- a/.config/nvim/after/plugin/harpoon.lua
+++ /dev/null
@@ -1,41 +0,0 @@
-local harpoon = require("harpoon")
-
--- REQUIRED
-harpoon:setup()
--- REQUIRED
-
-vim.keymap.set("n", "<leader>a", function() harpoon:list():append() end)
---vim.keymap.set("n", "<leader>q", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
-
-vim.keymap.set("n", "<C-h>", function() harpoon:list():select(1) end)
-vim.keymap.set("n", "<C-t>", function() harpoon:list():select(2) end)
-vim.keymap.set("n", "<C-n>", function() harpoon:list():select(3) end)
-vim.keymap.set("n", "<C-s>", function() harpoon:list():select(4) end)
-
--- Toggle previous & next buffers stored within Harpoon list
-vim.keymap.set("n", "<C-S-P>", function() harpoon:list():prev() end)
-vim.keymap.set("n", "<C-S-N>", function() harpoon:list():next() end)
-
-local harpoon = require('harpoon')
-harpoon:setup({})
-
--- basic telescope configuration
-local conf = require("telescope.config").values
-local function toggle_telescope(harpoon_files)
- local file_paths = {}
- for _, item in ipairs(harpoon_files.items) do
- table.insert(file_paths, item.value)
- end
-
- require("telescope.pickers").new({}, {
- prompt_title = "Harpoon",
- finder = require("telescope.finders").new_table({
- results = file_paths,
- }),
- previewer = conf.file_previewer({}),
- sorter = conf.generic_sorter({}),
- }):find()
-end
-
-vim.keymap.set("n", "<C-e>", function() toggle_telescope(harpoon:list()) end,
- { desc = "Open harpoon window" })
diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua
deleted file mode 100644
index 1139e3e..0000000
--- a/.config/nvim/after/plugin/lsp.lua
+++ /dev/null
@@ -1,32 +0,0 @@
-local lsp = require('lsp-zero')
-
-local cmp = require('cmp')
-local cmp_action = require('lsp-zero').cmp_action()
-
-cmp.setup({
- window = {
- completion = cmp.config.window.bordered(),
- documentation = cmp.config.window.bordered(),
- },
- mapping = cmp.mapping.preset.insert({
- ['<C-Space>'] = cmp.mapping.complete(),
- ['<C-n>'] = cmp_action.luasnip_jump_forward(),
- ['<C-p>'] = cmp_action.luasnip_jump_backward(),
- ['<C-u>'] = cmp.mapping.scroll_docs(-4),
- ['<C-d>'] = cmp.mapping.scroll_docs(4),
- })
-})
-
-require('lspconfig').clangd.setup({
- on_new_config = function(new_config, new_cwd)
- local status, cmake = pcall(require, "cmake-tools")
- if status then
- cmake.clangd_on_new_config(new_config)
- end
- end,
-})
-require('lspconfig').gopls.setup({})
-require('lspconfig').texlab.setup({})
-require('lspconfig').pyright.setup({})
-require('lspconfig').marksman.setup({})
-
diff --git a/.config/nvim/after/plugin/mason.lua b/.config/nvim/after/plugin/mason.lua
deleted file mode 100644
index ac26661..0000000
--- a/.config/nvim/after/plugin/mason.lua
+++ /dev/null
@@ -1 +0,0 @@
-require("mason").setup()
diff --git a/.config/nvim/after/plugin/nvim-dap-lldb.lua b/.config/nvim/after/plugin/nvim-dap-lldb.lua
deleted file mode 100644
index 7123093..0000000
--- a/.config/nvim/after/plugin/nvim-dap-lldb.lua
+++ /dev/null
@@ -1,35 +0,0 @@
-local dap = require('dap')
-dap.adapters.lldb = {
- type = 'executable',
- command = os.getenv( "HOME" ) .. '/.local/share/nvim/mason/bin/codelldb', -- adjust as needed, must be absolute path
- name = 'lldb'
-}
-
-local dap = require('dap')
-dap.configurations.c = {
- {
- name = 'Launch',
- type = 'lldb',
- request = 'launch',
- program = function()
- return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build/', '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,
- },
-}
-dap.configurations.cpp = dap.configurations.c
diff --git a/.config/nvim/after/plugin/telescope.lua b/.config/nvim/after/plugin/telescope.lua
deleted file mode 100644
index 87c9ea6..0000000
--- a/.config/nvim/after/plugin/telescope.lua
+++ /dev/null
@@ -1,6 +0,0 @@
-local builtin = require('telescope.builtin')
-vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
-vim.keymap.set('n', '<leader>fp', builtin.git_files, {})
-vim.keymap.set('n', '<leader>ps', function()
- builtin.grep_string({ search = vim.fn.input("Grep > ") })
-end)
diff --git a/.config/nvim/after/plugin/treesitter.lua b/.config/nvim/after/plugin/treesitter.lua
deleted file mode 100644
index b90bdcd..0000000
--- a/.config/nvim/after/plugin/treesitter.lua
+++ /dev/null
@@ -1,21 +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" },
-
- -- 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 = {
- 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/.config/nvim/init.lua b/.config/nvim/init.lua
index 9c8ca87..65a69f1 100644
--- a/.config/nvim/init.lua
+++ b/.config/nvim/init.lua
@@ -1 +1,4 @@
-require("jacob")
+require("plugins")
+require("set")
+require("remaps")
+
diff --git a/.config/nvim/lua/jacob/init.lua b/.config/nvim/lua/jacob/init.lua
deleted file mode 100644
index db8a563..0000000
--- a/.config/nvim/lua/jacob/init.lua
+++ /dev/null
@@ -1,3 +0,0 @@
-require("jacob.remaps")
-require("jacob.plugins")
-require("jacob.set")
diff --git a/.config/nvim/lua/jacob/plugins.lua b/.config/nvim/lua/jacob/plugins.lua
deleted file mode 100644
index fe07a27..0000000
--- a/.config/nvim/lua/jacob/plugins.lua
+++ /dev/null
@@ -1,69 +0,0 @@
--- Lazy.nvim plugin manager
-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)
-
-
-require("lazy").setup({
- {
- 'nvim-telescope/telescope.nvim', tag = '0.1.6',
- dependencies = { 'nvim-lua/plenary.nvim' }
- },
- {
- "ThePrimeagen/harpoon",
- branch = "harpoon2",
- dependencies = { "nvim-lua/plenary.nvim" }
- },
- {
- "NLKNguyen/papercolor-theme",
- -- config = function()
- -- vim.cmd('set t_Co=256')
- -- vim.cmd('set background=light')
- -- vim.cmd('colorscheme PaperColor')
- -- end
- },
- {
- 'folke/tokyonight.nvim',
- priority = 1000,
- --init = function()
- -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
- --vim.cmd.colorscheme 'tokyonight-day'
- --end,
- },
- { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", },
- {
- "mbbill/undotree",
- config = function()
- vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
- end
- },
- {'VonHeikemen/lsp-zero.nvim', branch = 'v3.x'},
- {'neovim/nvim-lspconfig'},
- {'hrsh7th/cmp-nvim-lsp'},
- {'hrsh7th/nvim-cmp'},
- {'L3MON4D3/LuaSnip'},
- {'williamboman/mason.nvim'},
- {"mfussenegger/nvim-dap" },
- {
- 'alljokecake/naysayer-theme.nvim',
- },
- {
- "sainnhe/everforest",
- init = function()
- vim.cmd.colorscheme 'everforest'
- vim.cmd('set background=dark')
- end,
- },
- {"shaunsingh/nord.nvim"},
- {"EdenEast/nightfox.nvim"},
- {"Civitasv/cmake-tools.nvim"},
-})
diff --git a/.config/nvim/lua/jacob/remaps.lua b/.config/nvim/lua/jacob/remaps.lua
deleted file mode 100644
index f06585c..0000000
--- a/.config/nvim/lua/jacob/remaps.lua
+++ /dev/null
@@ -1,68 +0,0 @@
-vim.g.mapleader = " "
-
--- Netrw Directory Listing
-vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
-
-vim.keymap.set("n", "<leader>mk", vim.cmd.make)
-
--- Quick Save
-vim.keymap.set("n", "<leader>w", vim.cmd.w)
-
-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]])
-
-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><leader>", function()
- vim.cmd("so")
-end)
-
--- remaps for debugger
-vim.keymap.set('n', '<leader>c', function() require('dap').continue() end)
-vim.keymap.set('n', '<leader>n', function() require('dap').step_over() end)
-vim.keymap.set('n', '<leader>i', function() require('dap').step_into() end)
-vim.keymap.set('n', '<leader>o', 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() 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/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua
new file mode 100644
index 0000000..fb1ed73
--- /dev/null
+++ b/.config/nvim/lua/plugins.lua
@@ -0,0 +1,42 @@
+-- Lazy.nvim plugin manager
+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)
+
+
+require("lazy").setup({
+ { 'nvim-telescope/telescope.nvim', tag = '0.1.6', dependencies = { 'nvim-lua/plenary.nvim' } },
+ { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
+ { "mbbill/undotree" },
+ {'neovim/nvim-lspconfig'},
+ { "sainnhe/everforest" },
+ {"Civitasv/cmake-tools.nvim"},
+})
+
+-- Enable preconfigured LSP's
+vim.lsp.enable({"clangd", "gopls", "texlab"})
+
+require'nvim-treesitter.configs'.setup {
+ ensure_installed = { "c" },
+ sync_install = false,
+ auto_install = true,
+
+ highlight = {
+ 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/.config/nvim/lua/remaps.lua b/.config/nvim/lua/remaps.lua
new file mode 100644
index 0000000..e2cbea9
--- /dev/null
+++ b/.config/nvim/lua/remaps.lua
@@ -0,0 +1,38 @@
+vim.g.mapleader = " "
+
+-- Netrw Directory Listing
+vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
+
+-- Quick Make
+vim.keymap.set("n", "<leader>mk", vim.cmd.make)
+
+-- Quick Save
+vim.keymap.set("n", "<leader>w", vim.cmd.w)
+
+-- Swap down
+vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
+-- Swap up
+vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
+
+-- Concat line below with space
+vim.keymap.set("n", "J", "mzJ`z")
+-- Page down with recenter
+vim.keymap.set("n", "<C-d>", "<C-d>zz")
+-- Page up with recenter
+vim.keymap.set("n", "<C-u>", "<C-u>zz")
+
+vim.keymap.set("n", "<C-h>", "<C-w>h")
+vim.keymap.set("n", "<C-j>", "<C-w>j")
+vim.keymap.set("n", "<C-k>", "<C-w>k")
+vim.keymap.set("n", "<C-l>", "<C-w>l")
+
+-- Telescope keybinds
+local tsBuiltin = require('telescope.builtin')
+vim.keymap.set('n', '<leader>ff', tsBuiltin.find_files, {})
+vim.keymap.set('n', '<leader>fp', tsBuiltin.git_files, {})
+vim.keymap.set('n', '<leader>ps', function()
+ tsBuiltin.grep_string({ search = vim.fn.input("Grep > ") })
+end)
+
+vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
+
diff --git a/.config/nvim/lua/jacob/set.lua b/.config/nvim/lua/set.lua
index 51996c2..ece5395 100644
--- a/.config/nvim/lua/jacob/set.lua
+++ b/.config/nvim/lua/set.lua
@@ -24,15 +24,19 @@ vim.opt.isfname:append("@-@")
vim.opt.updatetime = 50
-vim.opt.colorcolumn = "80"
+vim.opt.colorcolumn = "120"
vim.opt.mouse = 'a'
vim.opt.list = true
-vim.opt.listchars = { tab = 'ยป ', trail = 'ยท', nbsp = 'โฃ' }
+vim.opt.listchars = { tab = 'ยป ', trail = 'ยท', nbsp = 'โฃ', leadmultispace = 'ยท' }
-- Remove trailing whitespace
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
pattern = { "*" },
command = [[%s/\s\+$//e]],
})
+
+vim.cmd.colorscheme 'everforest'
+vim.cmd('set background=dark')
+