diff options
Diffstat (limited to '.config/nvim/lua/getchoo')
| -rw-r--r-- | .config/nvim/lua/getchoo/config.lua | 50 | ||||
| -rw-r--r-- | .config/nvim/lua/getchoo/keymap.lua | 27 | ||||
| -rw-r--r-- | .config/nvim/lua/getchoo/lsp/config/init.lua | 35 | ||||
| -rw-r--r-- | .config/nvim/lua/getchoo/lsp/init.lua | 2 | ||||
| -rw-r--r-- | .config/nvim/lua/getchoo/lsp/keymap.lua | 19 | ||||
| -rw-r--r-- | .config/nvim/lua/getchoo/lsp/server.lua | 10 | ||||
| -rw-r--r-- | .config/nvim/lua/getchoo/plugins.lua | 95 |
7 files changed, 132 insertions, 106 deletions
diff --git a/.config/nvim/lua/getchoo/config.lua b/.config/nvim/lua/getchoo/config.lua new file mode 100644 index 0000000..529dade --- /dev/null +++ b/.config/nvim/lua/getchoo/config.lua @@ -0,0 +1,50 @@ +-- +-- config for regular plugins +-- + +local M = {} + +M.bufferline = { + animation = true, + auto_hide = true, + icons = true, + maximum_padding = 2, + semantic_letters = true, +} + +local db = require("dashboard") +db.custom_center = { + { + desc = "find a file", + action = "Telescope fd", + }, + { + desc = "update plugins", + action = "PackerSync", + }, + { + desc = "update treesitter parsers", + actions = "TSUpdate", + }, +} + +db.custom_header = { + " ███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗", + " ████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║", + " ██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║", + " ██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║", + " ██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║", + " ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝", +} + +M.lualine = { + options = { + theme = "nord", + }, + extensions = { "nvim-tree" }, +} + +M.tree = {} + +require("getchoo.keymap") +return M diff --git a/.config/nvim/lua/getchoo/keymap.lua b/.config/nvim/lua/getchoo/keymap.lua new file mode 100644 index 0000000..b1b7a6a --- /dev/null +++ b/.config/nvim/lua/getchoo/keymap.lua @@ -0,0 +1,27 @@ +-- +-- keymaps for general plugins +-- + +local opts = { noremap = true, silent = true } +local set = function(mode, key, cmd) + vim.keymap.set(mode, key, cmd, opts) +end + +set("n", "<leader>t", function() + vim.cmd("NvimTreeToggle") +end) + +for i = 1, 9 do + set("n", "<leader>" .. i, function() + local cmd = "BufferGoto " .. i + vim.cmd(cmd) + end) +end + +set("n", "<leader>p", function() + vim.cmd("BufferPick") +end) + +set("n", "<leader>q", function() + vim.cmd("BufferClose") +end) diff --git a/.config/nvim/lua/getchoo/lsp/config/init.lua b/.config/nvim/lua/getchoo/lsp/config/init.lua index 7cb2cbb..be6c357 100644 --- a/.config/nvim/lua/getchoo/lsp/config/init.lua +++ b/.config/nvim/lua/getchoo/lsp/config/init.lua @@ -6,39 +6,6 @@ local null_ls = require("getchoo.lsp.config.null_ls") local M = {} -M.bufferline = { - animation = true, - auto_hide = true, - icons = true, - maximum_padding = 2, - semantic_letters = true, -} - -local db = require("dashboard") -db.custom_center = { - { - desc = "find a file", - action = "Telescope fd", - }, - { - desc = "update plugins", - action = "PackerSync", - }, - { - desc = "update treesitter parsers", - actions = "TSUpdate", - }, -} - -db.custom_header = { - " ███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗", - " ████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║", - " ██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║", - " ██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║", - " ██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║", - " ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝", -} - M.cmp = cmp.config M.lsp_servers = lsp_config.servers @@ -48,8 +15,6 @@ M.mason_lspconfig = mason.mason_lspconfig M.null_ls = null_ls.config -M.tree = {} - M.treesitter = { auto_install = true, highlight = { diff --git a/.config/nvim/lua/getchoo/lsp/init.lua b/.config/nvim/lua/getchoo/lsp/init.lua index a2ef780..aa3dde5 100644 --- a/.config/nvim/lua/getchoo/lsp/init.lua +++ b/.config/nvim/lua/getchoo/lsp/init.lua @@ -5,8 +5,6 @@ require("getchoo.lsp.server") require("getchoo.lsp.keymap") local config = require("getchoo.lsp.config") -require("bufferline").setup(config.bufferline) require("gitsigns").setup() -require("nvim-tree").setup(config.tree) require("nvim-treesitter.configs").setup(config.treesitter) require("trouble").setup(config.trouble) diff --git a/.config/nvim/lua/getchoo/lsp/keymap.lua b/.config/nvim/lua/getchoo/lsp/keymap.lua index 0df41d2..0a93db8 100644 --- a/.config/nvim/lua/getchoo/lsp/keymap.lua +++ b/.config/nvim/lua/getchoo/lsp/keymap.lua @@ -16,25 +16,6 @@ set("n", "<space>f", function() vim.cmd("Telescope") end) -set("n", "<leader>t", function() - vim.cmd("NvimTreeToggle") -end) - set("n", "<space>t", function() vim.cmd("TroubleToggle") end) - -for i = 1, 9 do - set("n", "<leader>" .. i, function() - local cmd = "BufferGoto " .. i - vim.cmd(cmd) - end) -end - -set("n", "<leader>p", function() - vim.cmd("BufferPick") -end) - -set("n", "<leader>q", function() - vim.cmd("BufferClose") -end) diff --git a/.config/nvim/lua/getchoo/lsp/server.lua b/.config/nvim/lua/getchoo/lsp/server.lua index 9c35aaf..c4ff20b 100644 --- a/.config/nvim/lua/getchoo/lsp/server.lua +++ b/.config/nvim/lua/getchoo/lsp/server.lua @@ -7,10 +7,12 @@ local lspconfig = require("lspconfig") local null_ls = require("null-ls") local config = require("getchoo.lsp.config") -require("mason").setup() -require("mason-lspconfig").setup(config.mason_lspconfig) -require("mason-tool-installer").setup(config.mason_tool_installer) -vim.opt.runtimepath:append("~/.local/share/nvim/mason/bin/") +if vim.g.use_mason then + require("mason").setup() + require("mason-lspconfig").setup(config.mason_lspconfig) + require("mason-tool-installer").setup(config.mason_tool_installer) + vim.opt.runtimepath:append("~/.local/share/nvim/mason/bin/") +end null_ls.setup(config.null_ls) cmp.setup(config.cmp) diff --git a/.config/nvim/lua/getchoo/plugins.lua b/.config/nvim/lua/getchoo/plugins.lua index 457b20f..35df46f 100644 --- a/.config/nvim/lua/getchoo/plugins.lua +++ b/.config/nvim/lua/getchoo/plugins.lua @@ -31,52 +31,57 @@ require("packer").startup(function(use) use("glepnir/dashboard-nvim") - -- lsp plugins - use("neovim/nvim-lspconfig") - - use({ - "jose-elias-alvarez/null-ls.nvim", - requires = { "nvim-lua/plenary.nvim" }, - }) - - use("williamboman/mason.nvim") - use("williamboman/mason-lspconfig") - use("whoissethdaniel/mason-tool-installer.nvim") - - use({ - "nvim-treesitter/nvim-treesitter", - run = function() - require("nvim-treesitter.install").update({ with_sync = true }) - end, - }) - - use("hrsh7th/nvim-cmp") - use("hrsh7th/cmp-nvim-lsp") - use("hrsh7th/cmp-buffer") - use("hrsh7th/cmp-path") - use("hrsh7th/cmp-vsnip") - use("hrsh7th/vim-vsnip") - use("L3MON4D3/LuaSnip") - use("saadparwaiz1/cmp_luasnip") - - use("kyazdani42/nvim-tree.lua") - + -- general use plugins use({ "romgrk/barbar.nvim", requires = { "kyazdani42/nvim-web-devicons" }, }) - use({ - "folke/trouble.nvim", - requires = { "kyazdani42/nvim-web-devicons" }, - }) - use({ - "nvim-telescope/telescope.nvim", - requires = { "nvim-lua/plenary.nvim" }, - }) - - use("lewis6991/gitsigns.nvim") use("ggandor/lightspeed.nvim") + use("kyazdani42/nvim-tree.lua") + + -- lsp plugins + if vim.g.use_lsp_plugins then + use("neovim/nvim-lspconfig") + + use({ + "jose-elias-alvarez/null-ls.nvim", + requires = { "nvim-lua/plenary.nvim" }, + }) + + if vim.g.use_mason then + use("williamboman/mason.nvim") + use("williamboman/mason-lspconfig") + use("whoissethdaniel/mason-tool-installer.nvim") + end + + use({ + "nvim-treesitter/nvim-treesitter", + run = function() + require("nvim-treesitter.install").update({ with_sync = true }) + end, + }) + + use("hrsh7th/nvim-cmp") + use("hrsh7th/cmp-nvim-lsp") + use("hrsh7th/cmp-buffer") + use("hrsh7th/cmp-path") + use("hrsh7th/cmp-vsnip") + use("hrsh7th/vim-vsnip") + use("L3MON4D3/LuaSnip") + use("saadparwaiz1/cmp_luasnip") + + use({ + "folke/trouble.nvim", + requires = { "kyazdani42/nvim-web-devicons" }, + }) + use({ + "nvim-telescope/telescope.nvim", + requires = { "nvim-lua/plenary.nvim" }, + }) + + use("lewis6991/gitsigns.nvim") + end if Packer_bootstrap then require("packer").sync() @@ -89,9 +94,7 @@ vim.g.nord_disable_background = true vim.g.nord_italic = false require("nord").set() -require("lualine").setup({ - options = { - theme = "nord", - }, - extensions = { "nvim-tree" }, -}) +local config = require("getchoo.config") +require("bufferline").setup(config.bufferline) +require("lualine").setup(config.lualine) +require("nvim-tree").setup(config.tree) |
