diff options
Diffstat (limited to '.config/nvim/lua')
| -rw-r--r-- | .config/nvim/lua/plugins.lua | 110 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/fugitive.lua | 3 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/harpoon.lua | 34 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/lualine.lua | 10 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/neo-tree.lua | 13 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/treesitter.lua | 14 | ||||
| -rw-r--r-- | .config/nvim/lua/simenandre/init.lua | 35 | ||||
| -rw-r--r-- | .config/nvim/lua/simenandre/remap.lua | 9 |
8 files changed, 195 insertions, 33 deletions
diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua new file mode 100644 index 0000000..39d5130 --- /dev/null +++ b/.config/nvim/lua/plugins.lua @@ -0,0 +1,110 @@ +return { + "ThePrimeagen/vim-be-good", + "gauteh/vim-norway", + { + "nvim-telescope/telescope.nvim", + tag = "0.1.5", + dependencies = { "nvim-lua/plenary.nvim" }, + }, + { + "rose-pine/neovim", + name = "rose-pine", + config = function() + vim.cmd("colorscheme rose-pine") + end, + }, + { + "VonHeikemen/lsp-zero.nvim", + branch = "v2.x", + dependencies = { + -- LSP Support + { "neovim/nvim-lspconfig" }, -- Required + { "williamboman/mason.nvim" }, -- Optional + { "williamboman/mason-lspconfig.nvim" }, -- Optional + + -- Autocompletion + { "hrsh7th/nvim-cmp", event = "InsertEnter" }, -- Required + { "hrsh7th/cmp-nvim-lsp" }, -- Required + { "L3MON4D3/LuaSnip" }, -- Required + }, + }, + "github/copilot.vim", + "nvim-lua/plenary.nvim", + { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 300 + end, + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }, + }, + { + "max397574/better-escape.nvim", + config = function() + require("better_escape").setup() + end, + }, + { + "nvimdev/lspsaga.nvim", + config = function() + require("lspsaga").setup({}) + end, + dependencies = { + "nvim-treesitter/nvim-treesitter", -- optional + "nvim-tree/nvim-web-devicons", -- optional + }, + }, + { + "stevearc/conform.nvim", + event = { "BufWritePre" }, + cmd = { "ConformInfo" }, + keys = { + { + -- Customize or remove this keymap to your liking + "<leader>f", + function() + require("conform").format({ async = true, lsp_fallback = true }) + end, + mode = "", + desc = "Format buffer", + }, + }, + -- Everything in opts will be passed to setup() + opts = { + -- Define your formatters + formatters_by_ft = { + lua = { "stylua" }, + python = { "isort", "black" }, + javascript = { { "prettierd", "prettier" } }, + markdown = { "deno_fmt", "prettierd" }, + }, + -- Set up format-on-save + format_on_save = { timeout_ms = 500, lsp_fallback = true }, + -- Customize formatters + formatters = { + shfmt = { + prepend_args = { "-i", "2" }, + }, + }, + }, + init = function() + -- If you want the formatexpr, here is the place to set it + vim.o.formatexpr = "v:lua.require'conform'.formatexpr()" + end, + }, + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended + "MunifTanjim/nui.nvim", + -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information + }, + }, +} diff --git a/.config/nvim/lua/plugins/fugitive.lua b/.config/nvim/lua/plugins/fugitive.lua new file mode 100644 index 0000000..0b426c0 --- /dev/null +++ b/.config/nvim/lua/plugins/fugitive.lua @@ -0,0 +1,3 @@ +return { + "tpope/vim-fugitive" +} diff --git a/.config/nvim/lua/plugins/harpoon.lua b/.config/nvim/lua/plugins/harpoon.lua new file mode 100644 index 0000000..797392d --- /dev/null +++ b/.config/nvim/lua/plugins/harpoon.lua @@ -0,0 +1,34 @@ +return { + "ThePrimeagen/harpoon", + branch = "harpoon2", + requires = { + { "nvim-lua/plenary.nvim" }, + }, + config = function() + local harpoon = require("harpoon") + + -- REQUIRED + harpoon:setup() + -- REQUIRED + + vim.keymap.set("n", "<leader>a", function() + harpoon:list():append() + end) + vim.keymap.set("n", "<C-e>", 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-j>", function() + harpoon:list():select(2) + end) + vim.keymap.set("n", "<C-k>", function() + harpoon:list():select(3) + end) + vim.keymap.set("n", "<C-l>", function() + harpoon:list():select(4) + end) + end, +} diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..d42cc85 --- /dev/null +++ b/.config/nvim/lua/plugins/lualine.lua @@ -0,0 +1,10 @@ +return { + "nvim-lualine/lualine.nvim", + config = function() + require("lualine").setup({ + options = { + theme = 'nightfly' + } + }) + end +} diff --git a/.config/nvim/lua/plugins/neo-tree.lua b/.config/nvim/lua/plugins/neo-tree.lua new file mode 100644 index 0000000..904ce46 --- /dev/null +++ b/.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", "<C-n>", ":Neotree filesystem reveal left<CR>", {}) + vim.keymap.set("n", "<leader>bf", ":Neotree buffers reveal float<CR>", {}) + end, +} diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..04ba7d8 --- /dev/null +++ b/.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({ + ensure_installed = { "lua", "javascript" }, + highlight = { enable = true }, + indent = { enable = true }, + }) + end, + }, +} diff --git a/.config/nvim/lua/simenandre/init.lua b/.config/nvim/lua/simenandre/init.lua index 2382eee..8dfcf77 100644 --- a/.config/nvim/lua/simenandre/init.lua +++ b/.config/nvim/lua/simenandre/init.lua @@ -1,39 +1,8 @@ require("simenandre.lazy") require("simenandre.set") +require("simenandre.remap") vim.g.mapleader = " " -- Make sure to set `mapleader` before lazy so your mappings are correct -require("lazy").setup({ - "ThePrimeagen/vim-be-good", - { - 'rose-pine/neovim', - name = 'rose-pine', - config = function() - vim.cmd('colorscheme rose-pine') - end - }, - { - 'VonHeikemen/lsp-zero.nvim', - branch = 'v2.x', - dependencies = { - -- LSP Support - {'neovim/nvim-lspconfig'}, -- Required - {'williamboman/mason.nvim'}, -- Optional - {'williamboman/mason-lspconfig.nvim'}, -- Optional - - -- Autocompletion - {'hrsh7th/nvim-cmp'}, -- Required - {'hrsh7th/cmp-nvim-lsp'}, -- Required - {'L3MON4D3/LuaSnip'}, -- Required - } - }, - { - "nvim-treesitter/nvim-treesitter", - run = function() - local ts_update = require('nvim-treesitter.install').update({ with_sync = true }) - ts_update() - end - }, - "github/copilot.vim" -}) +require("lazy").setup("plugins") diff --git a/.config/nvim/lua/simenandre/remap.lua b/.config/nvim/lua/simenandre/remap.lua new file mode 100644 index 0000000..ee5bdb0 --- /dev/null +++ b/.config/nvim/lua/simenandre/remap.lua @@ -0,0 +1,9 @@ +vim.g.mapleader = " " + +vim.keymap.set("i", "<C-c>", "<Esc>") +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") |
