summaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2024-03-26 21:43:28 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2024-03-26 21:43:28 -0400
commit4a903ca920b43184efb05a30c0bb79d21b56e0a9 (patch)
tree78b8a674f404954af127a2cf7546780824c3b904 /.config
parentf4b64685c4e5e80bd279cbb7d6f1c774041e7baa (diff)
Updated neovim based on theprimagen
Diffstat (limited to '.config')
-rw-r--r--.config/hypr/hyprland.conf6
-rw-r--r--.config/nvim.bak/.netrwhist (renamed from .config/nvim/.netrwhist)0
-rw-r--r--.config/nvim.bak/colors/gruvbox.vim (renamed from .config/nvim/colors/gruvbox.vim)0
-rw-r--r--.config/nvim.bak/init.vim (renamed from .config/nvim/init.vim)0
-rw-r--r--.config/nvim.bak/lua/dap_lldb.lua (renamed from .config/nvim/lua/dap_lldb.lua)0
-rw-r--r--.config/nvim.bak/lua/lsp_config.lua (renamed from .config/nvim/lua/lsp_config.lua)0
-rw-r--r--.config/nvim/after/plugin/harpoon.lua41
-rw-r--r--.config/nvim/after/plugin/lsp.lua20
-rw-r--r--.config/nvim/after/plugin/telescope.lua6
-rw-r--r--.config/nvim/after/plugin/treesitter.lua21
-rw-r--r--.config/nvim/init.lua1
-rw-r--r--.config/nvim/lazy-lock.json14
-rw-r--r--.config/nvim/lua/jacob/init.lua3
-rw-r--r--.config/nvim/lua/jacob/plugins.lua58
-rw-r--r--.config/nvim/lua/jacob/remaps.lua42
-rw-r--r--.config/nvim/lua/jacob/set.lua32
16 files changed, 244 insertions, 0 deletions
diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf
index 1dcfaa2..20b91b9 100644
--- a/.config/hypr/hyprland.conf
+++ b/.config/hypr/hyprland.conf
@@ -150,6 +150,12 @@ bind = $mainMod, L, movefocus, r
bind = $mainMod, K, movefocus, u
bind = $mainMod, J, movefocus, d
+# Move windows around
+bind = $mainMod SHIFT, H, movewindow, l
+bind = $mainMod SHIFT, L, movewindow, r
+bind = $mainMod SHIFT, K, movewindow, u
+bind = $mainMod SHIFT, J, movewindow, d
+
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
diff --git a/.config/nvim/.netrwhist b/.config/nvim.bak/.netrwhist
index f1f9805..f1f9805 100644
--- a/.config/nvim/.netrwhist
+++ b/.config/nvim.bak/.netrwhist
diff --git a/.config/nvim/colors/gruvbox.vim b/.config/nvim.bak/colors/gruvbox.vim
index 66246fb..66246fb 100644
--- a/.config/nvim/colors/gruvbox.vim
+++ b/.config/nvim.bak/colors/gruvbox.vim
diff --git a/.config/nvim/init.vim b/.config/nvim.bak/init.vim
index 7bb71b7..7bb71b7 100644
--- a/.config/nvim/init.vim
+++ b/.config/nvim.bak/init.vim
diff --git a/.config/nvim/lua/dap_lldb.lua b/.config/nvim.bak/lua/dap_lldb.lua
index 40861d0..40861d0 100644
--- a/.config/nvim/lua/dap_lldb.lua
+++ b/.config/nvim.bak/lua/dap_lldb.lua
diff --git a/.config/nvim/lua/lsp_config.lua b/.config/nvim.bak/lua/lsp_config.lua
index be7e018..be7e018 100644
--- a/.config/nvim/lua/lsp_config.lua
+++ b/.config/nvim.bak/lua/lsp_config.lua
diff --git a/.config/nvim/after/plugin/harpoon.lua b/.config/nvim/after/plugin/harpoon.lua
new file mode 100644
index 0000000..08b092a
--- /dev/null
+++ b/.config/nvim/after/plugin/harpoon.lua
@@ -0,0 +1,41 @@
+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
new file mode 100644
index 0000000..0960abc
--- /dev/null
+++ b/.config/nvim/after/plugin/lsp.lua
@@ -0,0 +1,20 @@
+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({})
diff --git a/.config/nvim/after/plugin/telescope.lua b/.config/nvim/after/plugin/telescope.lua
new file mode 100644
index 0000000..87c9ea6
--- /dev/null
+++ b/.config/nvim/after/plugin/telescope.lua
@@ -0,0 +1,6 @@
+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
new file mode 100644
index 0000000..b90bdcd
--- /dev/null
+++ b/.config/nvim/after/plugin/treesitter.lua
@@ -0,0 +1,21 @@
+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
new file mode 100644
index 0000000..9c8ca87
--- /dev/null
+++ b/.config/nvim/init.lua
@@ -0,0 +1 @@
+require("jacob")
diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json
new file mode 100644
index 0000000..12d569f
--- /dev/null
+++ b/.config/nvim/lazy-lock.json
@@ -0,0 +1,14 @@
+{
+ "LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" },
+ "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
+ "harpoon": { "branch": "harpoon2", "commit": "a38be6e0dd4c6db66997deab71fc4453ace97f9c" },
+ "lazy.nvim": { "branch": "main", "commit": "d37a76b87137c777f3d778ed03729d7f332a85f0" },
+ "lsp-zero.nvim": { "branch": "v3.x", "commit": "2b5e9a39b3bf60bfb0cc7c35d5f2e879d4cd72ea" },
+ "nvim-cmp": { "branch": "main", "commit": "97dc716fc914c46577a4f254035ebef1aa72558a" },
+ "nvim-lspconfig": { "branch": "master", "commit": "6e5c78ebc9936ca74add66bda22c566f951b6ee5" },
+ "nvim-treesitter": { "branch": "master", "commit": "7f3179315959bd762abd0f8dbe0361db805fb2d4" },
+ "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" },
+ "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" },
+ "tokyonight.nvim": { "branch": "main", "commit": "f4b415bfbce390866a83277db42cf6aa94230728" },
+ "undotree": { "branch": "master", "commit": "aa93a7e5890dbbebbc064cd22260721a6db1a196" }
+} \ No newline at end of file
diff --git a/.config/nvim/lua/jacob/init.lua b/.config/nvim/lua/jacob/init.lua
new file mode 100644
index 0000000..db8a563
--- /dev/null
+++ b/.config/nvim/lua/jacob/init.lua
@@ -0,0 +1,3 @@
+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
new file mode 100644
index 0000000..83675c0
--- /dev/null
+++ b/.config/nvim/lua/jacob/plugins.lua
@@ -0,0 +1,58 @@
+-- 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()
+ -- Like many other themes, this one has different styles, and you could load
+ -- 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'},
+})
diff --git a/.config/nvim/lua/jacob/remaps.lua b/.config/nvim/lua/jacob/remaps.lua
new file mode 100644
index 0000000..02f1709
--- /dev/null
+++ b/.config/nvim/lua/jacob/remaps.lua
@@ -0,0 +1,42 @@
+vim.g.mapleader = " "
+
+-- Netrw Directory Listing
+vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
+
+-- 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)
+
diff --git a/.config/nvim/lua/jacob/set.lua b/.config/nvim/lua/jacob/set.lua
new file mode 100644
index 0000000..a71211e
--- /dev/null
+++ b/.config/nvim/lua/jacob/set.lua
@@ -0,0 +1,32 @@
+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.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.scrolloff = 8
+vim.opt.signcolumn = "yes"
+vim.opt.isfname:append("@-@")
+
+vim.opt.updatetime = 50
+
+vim.opt.colorcolumn = "80"
+
+vim.opt.mouse = 'a'
+
+vim.opt.list = true
+vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }