diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua new file mode 100644 index 0000000..20bcba7 --- /dev/null +++ b/dot_config/nvim/init.lua @@ -0,0 +1,15 @@ +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("vim-options") +require("lazy").setup("plugins") diff --git a/dot_config/nvim/lua/plugins.lua b/dot_config/nvim/lua/plugins.lua new file mode 100644 index 0000000..a564707 --- /dev/null +++ b/dot_config/nvim/lua/plugins.lua @@ -0,0 +1 @@ +return {} diff --git a/dot_config/nvim/lua/plugins/alpha.lua b/dot_config/nvim/lua/plugins/alpha.lua new file mode 100644 index 0000000..d6638ae --- /dev/null +++ b/dot_config/nvim/lua/plugins/alpha.lua @@ -0,0 +1,31 @@ +return { + "goolord/alpha-nvim", + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + + config = function() + local alpha = require("alpha") + local dashboard = require("alpha.themes.startify") + + dashboard.section.header.val = { + [[ ]], + [[ ]], + [[ ]], + [[ ]], + [[  ]], + [[ ████ ██████ █████ ██ ]], + [[ ███████████ █████  ]], + [[ █████████ ███████████████████ ███ ███████████ ]], + [[ █████████ ███ █████████████ █████ ██████████████ ]], + [[ █████████ ██████████ █████████ █████ █████ ████ █████ ]], + [[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]], + [[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]], + [[ ]], + [[ ]], + [[ ]], + } + + alpha.setup(dashboard.opts) + end, +} diff --git a/dot_config/nvim/lua/plugins/catppuccin.lua b/dot_config/nvim/lua/plugins/catppuccin.lua new file mode 100644 index 0000000..988b00f --- /dev/null +++ b/dot_config/nvim/lua/plugins/catppuccin.lua @@ -0,0 +1,11 @@ +return { + { + "catppuccin/nvim", + lazy = false, + name = "catppuccin", + priority = 1000, + config = function() + vim.cmd.colorscheme "catppuccin-mocha" + end + } +} diff --git a/dot_config/nvim/lua/plugins/completions.lua b/dot_config/nvim/lua/plugins/completions.lua new file mode 100644 index 0000000..2e7396a --- /dev/null +++ b/dot_config/nvim/lua/plugins/completions.lua @@ -0,0 +1,44 @@ +return { + { + "hrsh7th/cmp-nvim-lsp" + }, + { + "L3MON4D3/LuaSnip", + dependencies = { + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets", + }, + }, + { + "hrsh7th/nvim-cmp", + config = function() + local cmp = require("cmp") + require("luasnip.loaders.from_vscode").lazy_load() + + cmp.setup({ + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, -- For luasnip users. + }, { + { name = "buffer" }, + }), + }) + end, + }, +} diff --git a/dot_config/nvim/lua/plugins/git-stuff.lua b/dot_config/nvim/lua/plugins/git-stuff.lua new file mode 100644 index 0000000..ac4588d --- /dev/null +++ b/dot_config/nvim/lua/plugins/git-stuff.lua @@ -0,0 +1,14 @@ +return { + { + "tpope/vim-fugitive" + }, + { + "lewis6991/gitsigns.nvim", + config = function() + require("gitsigns").setup() + + vim.keymap.set("n", "gp", ":Gitsigns preview_hunk", {}) + vim.keymap.set("n", "gt", ":Gitsigns toggle_current_line_blame", {}) + end + } +} diff --git a/dot_config/nvim/lua/plugins/gitsigns.lua b/dot_config/nvim/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..687fd25 --- /dev/null +++ b/dot_config/nvim/lua/plugins/gitsigns.lua @@ -0,0 +1,11 @@ +return { + { + "tpope/vim-fugitive", + }, + { + "lewis6991/gitsigns.nvim", + config = function() + require("gitsigns").setup() + end, + } +} diff --git a/dot_config/nvim/lua/plugins/lsp-config.lua b/dot_config/nvim/lua/plugins/lsp-config.lua new file mode 100644 index 0000000..cc52058 --- /dev/null +++ b/dot_config/nvim/lua/plugins/lsp-config.lua @@ -0,0 +1,56 @@ +return { + { + "williamboman/mason.nvim", + lazy = false, + config = function() + require("mason").setup() + end, + }, + { + "williamboman/mason-lspconfig.nvim", + lazy = false, + config = function () + require("mason-lspconfig").setup({ + ensure_installed = { "lua_ls", "ansiblels", "bashls", "pylsp" } + }) + end, + opts = { + auto_install = true, + }, + }, + { + "neovim/nvim-lspconfig", + lazy = false, + config = function() + local capabilities = require('cmp_nvim_lsp').default_capabilities() + + local lspconfig = require("lspconfig") + lspconfig.ts_ls.setup({ + capabilities = capabilities + }) + lspconfig.ansiblels.setup({ + capabilities = capabilities + }) + lspconfig.bashls.setup({ + capabilities = capabilities + }) + lspconfig.pyls.setup({ + capabilities = capabilities + }) + lspconfig.solargraph.setup({ + capabilities = capabilities + }) + lspconfig.html.setup({ + capabilities = capabilities + }) + lspconfig.lua_ls.setup({ + capabilities = capabilities + }) + + vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) + vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) + end, + }, +} diff --git a/dot_config/nvim/lua/plugins/neo-tree.lua b/dot_config/nvim/lua/plugins/neo-tree.lua new file mode 100644 index 0000000..f614d0f --- /dev/null +++ b/dot_config/nvim/lua/plugins/neo-tree.lua @@ -0,0 +1,13 @@ +return { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + }, + config = function() + vim.keymap.set("n", "n", ":Neotree filesystem reveal left", {}) + vim.keymap.set("n", "bf", ":Neotree buffers reveal float", {}) + end, +} diff --git a/dot_config/nvim/lua/plugins/none-ls.lua b/dot_config/nvim/lua/plugins/none-ls.lua new file mode 100644 index 0000000..9820978 --- /dev/null +++ b/dot_config/nvim/lua/plugins/none-ls.lua @@ -0,0 +1,21 @@ +return { + "nvimtools/none-ls.nvim", + config = function() + local null_ls = require("null-ls") + null_ls.setup({ + sources = { + null_ls.builtins.formatting.stylua, + null_ls.builtins.formatting.prettier, + null_ls.builtins.formatting.black, + null_ls.builtins.formatting.isort, + null_ls.builtins.formatting.yamlfmt, + null_ls.builtins.formatting.yamlfix, + null_ls.builtins.diagnostics.erb_lint, + null_ls.builtins.diagnostics.rubocop, + null_ls.builtins.formatting.rubocop, + }, + }) + + vim.keymap.set("n", "gf", vim.lsp.buf.format, {}) + end, +} diff --git a/dot_config/nvim/lua/plugins/nvim-tmux-navigation.lua b/dot_config/nvim/lua/plugins/nvim-tmux-navigation.lua new file mode 100644 index 0000000..867d0e8 --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-tmux-navigation.lua @@ -0,0 +1,10 @@ +return { + "alexghergh/nvim-tmux-navigation", + config = function() + require('nvim-tmux-navigation').setup({}) + vim.keymap.set("n", "", "NvimTmuxNavigateLeft", {}) + vim.keymap.set("n", "", "NvimTmuxNavigateDown", {}) + vim.keymap.set("n", "", "NvimTmuxNavigateUp", {}) + vim.keymap.set("n", "", "NvimTmuxNavigateRight", {}) + end, +} diff --git a/dot_config/nvim/lua/plugins/oil.lua b/dot_config/nvim/lua/plugins/oil.lua new file mode 100644 index 0000000..ab18cde --- /dev/null +++ b/dot_config/nvim/lua/plugins/oil.lua @@ -0,0 +1,8 @@ +return { + "stevearc/oil.nvim", + config = function() + local oil = require("oil") + oil.setup() + vim.keymap.set("n", "-", oil.toggle_float, {}) + end, +} diff --git a/dot_config/nvim/lua/plugins/silicon.lua b/dot_config/nvim/lua/plugins/silicon.lua new file mode 100644 index 0000000..c953f0e --- /dev/null +++ b/dot_config/nvim/lua/plugins/silicon.lua @@ -0,0 +1,22 @@ +return { + 'krivahtoo/silicon.nvim', + run = './install.sh build', + opts = { + line_number = true, + pad_horiz = 60, + pad_vert = 40, + gobble = true, + window_controls = false, + tab_width = 2, + font = 'FantasqeSanseMono Nerd Font=26', + theme = 'catpuccine-mocca', + window_title = function() + return vim.fn.fnamemodify(vim.fn.bufname(vim.fn.bufnr()), ':~:.') + end, + }, + lazy = true, + config = function(_, opts) + require("silicon").setup(opts) + end, + cmd = { "Silicon" }, +} diff --git a/dot_config/nvim/lua/plugins/telescope.lua b/dot_config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..710d0e8 --- /dev/null +++ b/dot_config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,25 @@ +return { + { + "nvim-telescope/telescope-ui-select.nvim", + }, + { + "nvim-telescope/telescope.nvim", + tag = "0.1.5", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + require("telescope").setup({ + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown({}), + }, + }, + }) + local builtin = require("telescope.builtin") + vim.keymap.set("n", "", builtin.find_files, {}) + vim.keymap.set("n", "fg", builtin.live_grep, {}) + vim.keymap.set("n", "", builtin.oldfiles, {}) + + require("telescope").load_extension("ui-select") + end, + }, +} diff --git a/dot_config/nvim/lua/plugins/treesitter.lua b/dot_config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..6312070 --- /dev/null +++ b/dot_config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,14 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + local config = require("nvim-treesitter.configs") + config.setup({ + auto_install = true, + highlight = { enable = true }, + indent = { enable = true }, + }) + end + } +} diff --git a/dot_config/nvim/lua/plugins/vim-test.lua b/dot_config/nvim/lua/plugins/vim-test.lua new file mode 100644 index 0000000..500e95c --- /dev/null +++ b/dot_config/nvim/lua/plugins/vim-test.lua @@ -0,0 +1,14 @@ +return { + "vim-test/vim-test", + dependencies = { + "preservim/vimux" + }, + config = function() + vim.keymap.set("n", "t", ":TestNearest", {}) + vim.keymap.set("n", "T", ":TestFile", {}) + vim.keymap.set("n", "a", ":TestSuite", {}) + vim.keymap.set("n", "l", ":TestLast", {}) + vim.keymap.set("n", "g", ":TestVisit", {}) + vim.cmd("let test#strategy = 'vimux'") + end, +} diff --git a/dot_config/nvim/lua/vim-options.lua b/dot_config/nvim/lua/vim-options.lua new file mode 100644 index 0000000..a94a27b --- /dev/null +++ b/dot_config/nvim/lua/vim-options.lua @@ -0,0 +1,18 @@ +vim.cmd("set expandtab") +vim.cmd("set tabstop=2") +vim.cmd("set softtabstop=2") +vim.cmd("set shiftwidth=2") +vim.g.mapleader = " " +vim.g.background = "light" + +vim.opt.swapfile = false + +-- Navigate vim panes better +vim.keymap.set('n', '', ':wincmd k') +vim.keymap.set('n', '', ':wincmd j') +vim.keymap.set('n', '', ':wincmd h') +vim.keymap.set('n', '', ':wincmd l') + +vim.keymap.set('n', 'h', ':nohlsearch') +vim.wo.number = true + diff --git a/dot_config/nvim/lua/which-key.lua b/dot_config/nvim/lua/which-key.lua new file mode 100644 index 0000000..9fadb97 --- /dev/null +++ b/dot_config/nvim/lua/which-key.lua @@ -0,0 +1,18 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }, + keys = { + { + "?", + function() + require("which-key").show({ global = false }) + end, + desc = "Buffer Local Keymaps (which-key)", + }, + }, +}