diff options
author | Luca Matei Pintilie <lucafulger@gmail.com> | 2022-09-08 17:29:21 +0000 |
---|---|---|
committer | Luca Matei Pintilie <lucafulger@gmail.com> | 2022-09-08 17:29:21 +0000 |
commit | b57d4cb883e8f016cfbc89c87e6594f0c2aef1ff (patch) | |
tree | 39576dcd545bb0a1c41c4af9bdf00d89ebb9198f /.config | |
parent | f13e82880cfcb566df62d9d3c787cc021273142e (diff) | |
download | dotfiles-b57d4cb883e8f016cfbc89c87e6594f0c2aef1ff.tar dotfiles-b57d4cb883e8f016cfbc89c87e6594f0c2aef1ff.tar.gz dotfiles-b57d4cb883e8f016cfbc89c87e6594f0c2aef1ff.tar.bz2 dotfiles-b57d4cb883e8f016cfbc89c87e6594f0c2aef1ff.tar.lz dotfiles-b57d4cb883e8f016cfbc89c87e6594f0c2aef1ff.tar.xz dotfiles-b57d4cb883e8f016cfbc89c87e6594f0c2aef1ff.tar.zst dotfiles-b57d4cb883e8f016cfbc89c87e6594f0c2aef1ff.zip |
New neovim config
Diffstat (limited to '.config')
-rw-r--r-- | .config/nvim/.lua-format | 4 | ||||
-rw-r--r-- | .config/nvim/init.lua | 368 | ||||
-rw-r--r-- | .config/nvim/lua/filetree.lua | 2 | ||||
-rw-r--r-- | .config/nvim/lua/general.lua | 34 | ||||
-rw-r--r-- | .config/nvim/lua/keybinds.lua | 25 | ||||
-rw-r--r-- | .config/nvim/lua/lsp.lua | 84 | ||||
-rw-r--r-- | .config/nvim/lua/plugins.lua | 169 | ||||
-rw-r--r-- | .config/nvim/lua/statusline.lua | 31 |
8 files changed, 355 insertions, 362 deletions
diff --git a/.config/nvim/.lua-format b/.config/nvim/.lua-format index 0c78da7..68bc960 100644 --- a/.config/nvim/.lua-format +++ b/.config/nvim/.lua-format @@ -19,9 +19,9 @@ break_before_functiondef_rp: false align_table_field: true break_after_table_lb: true break_before_table_rb: true -chop_down_table: false +chop_down_table: true chop_down_kv_table: true -table_sep: "," +table_sep: ";" extra_sep_at_table_end: true column_table_limit: 80 spaces_inside_table_braces: true diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 62149da..97627f4 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,364 +1,12 @@ --- :vi ft=lua -local fn = vim.fn -local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim" -local packer_bootstrap -if fn.empty(fn.glob(install_path)) > 0 then - packer_bootstrap = fn.system({ - "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", - install_path, - }) -end +local plugins = require("plugins") -vim.api.nvim_set_option("mouse", "a") -vim.api.nvim_command("set number relativenumber") -vim.api.nvim_set_option("termguicolors", true) --- Comment the following lines to disable whitespace characters -vim.opt.list = true -vim.opt.listchars:append("space:⋅") -vim.opt.listchars:append("eol:↴") -vim.opt.listchars:append("tab:-->") +if plugins.clone_paq() == true then plugins.bootstrap_paq() end --- VSCode like moving lines up and down with alt+{j,k} -vim.api.nvim_command("nnoremap <A-j> :m .+1<CR>==") -vim.api.nvim_command("nnoremap <A-k> :m .-2<CR>==") -vim.api.nvim_command("inoremap <A-j> <Esc>:m .+1<CR>==gi") -vim.api.nvim_command("inoremap <A-k> <Esc>:m .-2<CR>==gi") -vim.api.nvim_command("vnoremap <A-j> :m '>+1<CR>gv=gv") -vim.api.nvim_command("vnoremap <A-k> :m '<-2<CR>gv=gv") -vim.api.nvim_command( - "nnoremap <buffer> <M-CR> :lua vim.lsp.buf.code_action()<CR>") +require("filetree") +require("keybinds") +require("general") +require("statusline") +require("lsp") -return require("packer").startup(function(use) - -- Package manager - use { "https://github.com/wbthomason/packer.nvim" } +plugins.init_plugins() - use { "https://github.com/vladdoster/remember.nvim" } - - use { - "https://github.com/filipdutescu/renamer.nvim", - branch = "master", - requires = { { "https://github.com/nvim-lua/plenary.nvim" } }, - config = function() - vim.api.nvim_set_keymap("i", "<F2>", - "<cmd>lua require(\"renamer\").rename()<cr>", - { noremap = true, silent = true }) - vim.api.nvim_set_keymap("n", "<leader>rn", - "<cmd>lua require(\"renamer\").rename()<cr>", - { noremap = true, silent = true }) - vim.api.nvim_set_keymap("v", "<leader>rn", - "<cmd>lua require(\"renamer\").rename()<cr>", - { noremap = true, silent = true }) - - end, - } - - -- File tree - use { - "https://github.com/kyazdani42/nvim-tree.lua", - requires = { - "https://github.com/kyazdani42/nvim-web-devicons", -- optional, for file icon - }, - cmd = { "NvimTreeToggle" }, - setup = function() - vim.api.nvim_set_keymap("n", "<c-n>", ":NvimTreeToggle<CR>", - { noremap = true, silent = true }) - end, - config = function() - require"nvim-tree".setup { - auto_reload_on_write = true, - update_cwd = true, - view = { - width = 30, - height = 30, - hide_root_folder = false, - side = "left", - preserve_window_proportions = false, - number = true, - relativenumber = true, - signcolumn = "yes", - }, - renderer = { indent_markers = { enable = true } }, - diagnostics = { - enable = true, - show_on_dirs = true, - icons = { hint = "", info = "", warning = "", error = "" }, - }, - } - end, - -- tag = "nightly" -- optional, updated every week. (see issue #1193) - } - - use { - "https://github.com/nvim-telescope/telescope.nvim", - cmd = { "Telescope" }, - requires = { { "https://github.com/nvim-lua/plenary.nvim" } }, - setup = function() - vim.api.nvim_set_keymap("n", "<c-f>", ":Telescope find_files<CR>", - { noremap = true, silent = true }) - vim.api.nvim_set_keymap("n", "<c-TAB>", ":Telescope buffers<CR>", - { noremap = true, silent = true }) - end, - } - use { - "https://github.com/akinsho/bufferline.nvim", - config = function() require("bufferline").setup { diagnostics = "nvim_lsp" } end, - } - use { - "https://github.com/nvim-lualine/lualine.nvim", - requires = { "https://github.com/kyazdani42/nvim-web-devicons", opt = true }, - config = function() - -- local tabline = require("tabline") - require("lualine").setup { - options = { - icons_enabled = true, - theme = "auto", - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - disabled_filetypes = {}, - always_divide_middle = true, - globalstatus = false, - }, - sections = { - lualine_a = { "mode" }, - lualine_b = { "branch", "diff", "diagnostics" }, - lualine_c = { "filename" }, - lualine_x = { "encoding", "fileformat", "filetype" }, - lualine_y = { "progress" }, - lualine_z = { "location" }, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { "filename" }, - lualine_x = { "location" }, - lualine_y = {}, - lualine_z = {}, - }, - extensions = {}, - } - end, - } - - use { - "https://github.com/karb94/neoscroll.nvim", - config = function() require("neoscroll").setup() end, - } - - use { - "https://github.com/lukas-reineke/indent-blankline.nvim", - setup = function() vim.api.nvim_set_option("termguicolors", true) end, - config = function() - require("indent_blankline").setup { - show_end_of_line = true, - space_char_blankline = " ", - show_current_context = true, - show_current_context_start = true, - - } - - end, - } - - use { - "https://github.com/nvim-treesitter/nvim-treesitter", - config = function() - require"nvim-treesitter.configs".setup { - -- A list of parser names, or "all" - ensure_installed = { "javascript", "lua", "rust" }, - - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, - - -- List of parsers to ignore installing (for "all") - -- ignore_install = {}, - - highlight = { - -- `false` will disable the whole extension - enable = true, - - -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to - -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is - -- the name of the parser) - -- list of language that will be disabled - -- disable = { "c", "rust" }, - - -- 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, - }, - } - end, - } - - use { - "https://github.com/norcalli/nvim-colorizer.lua", - config = function() require("colorizer").setup() end, - } - - use { - "https://github.com/google/vim-coverage", - requires = "https://github.com/google/vim-maktaba", - } - - use { "https://github.com/prettier/vim-prettier", cmd = { "Prettier" } } - - use { "https://github.com/editorconfig/editorconfig-vim" } - - use { - requires = "https://github.com/neovim/nvim-lspconfig", - "https://github.com/williamboman/nvim-lsp-installer", - config = function() - local lsp_installer = require("nvim-lsp-installer") - -- local nvim_lsp = require'nvim_lsp' - -- Disable Diagnostcs globally - -- vim.lsp.handlers["textDocument/publishDiagnostics"] = function() end - - lsp_installer.on_server_ready(function(server) - local opts = {} - - if server.name == "denols" then - opts.root_dir = vim.loop.cwd - opts.init_options = { - enable = true, - unstable = false, - config = "./deno.jsonc" - } - end - - server:setup(opts) - vim.cmd [[ do User LspAttachBuffers ]] - end) - end, - } - - use { - "https://github.com/hrsh7th/nvim-cmp", - requires = { - "https://github.com/neovim/nvim-lspconfig", - "https://github.com/hrsh7th/cmp-nvim-lsp", - "https://github.com/hrsh7th/cmp-buffer", - "https://github.com/hrsh7th/cmp-path", - "https://github.com/hrsh7th/cmp-cmdline", - "https://github.com/hrsh7th/cmp-vsnip", - "https://github.com/hrsh7th/vim-vsnip", - "https://github.com/onsails/lspkind.nvim", - }, - config = function() - -- Setup nvim-cmp. - local cmp = require "cmp" - - cmp.setup({ - snippet = { - -- REQUIRED - you must specify a snippet engine - expand = function(args) - vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - ["<C-b>"] = cmp.mapping.scroll_docs(-4), - ["<C-f>"] = cmp.mapping.scroll_docs(4), - ["<C-Space>"] = cmp.mapping.complete(), - ["<C-e>"] = cmp.mapping.abort(), - ["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - }), - sources = cmp.config.sources({ - { name = "nvim_lsp" }, { name = "vsnip" }, -- For vsnip users. - }, { { name = "buffer" } }), - }) - - -- Set configuration for specific filetype. - cmp.setup.filetype("gitcommit", { - sources = cmp.config.sources({ - { name = "cmp_git" }, -- You can specify the `cmp_git` source if you were installed it. - }, { { name = "buffer" } }), - }) - - -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline("/", { - mapping = cmp.mapping.preset.cmdline(), - sources = { { name = "buffer" } }, - }) - - -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline(":", { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config - .sources({ { name = "path" } }, { { name = "cmdline" } }), - }) - - -- Setup lspconfig. - local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp - .protocol - .make_client_capabilities()) - -- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled. - require("lspconfig")["denols"].setup { capabilities = capabilities } - local lspkind = require("lspkind") - cmp.setup { - formatting = { - format = lspkind.cmp_format({ - mode = "symbol", -- show only symbol annotations - maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) - - -- The function below will be called before any actual modifications from lspkind - -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30)) - before = function(entry, vim_item) return vim_item end, - }), - }, - } - - end, - } - - use { - "https://github.com/nathom/filetype.nvim", - setup = function() vim.g.did_load_filetypes = 1 end, - } - - use { - "https://github.com/dracula/vim", - config = function() vim.api.nvim_command("colorscheme dracula") end, - } - - use { - "https://github.com/lukas-reineke/lsp-format.nvim", - requires = { "https://github.com/neovim/nvim-lspconfig" }, - config = function() - require"lsp-format".setup { - typescript = { tab_width = 4 }, - yaml = { tab_width = 2 }, - } - end, - } - - use { - "https://github.com/folke/trouble.nvim", - requires = "https://github.com/kyazdani42/nvim-web-devicons", - config = function() - require("trouble").setup { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - } - vim.api.nvim_command("nnoremap <buffer> <M-,> :TroubleToggle<CR>") - end, - } - - use { - "https://github.com/wfxr/minimap.vim", - setup = function() - vim.g["minimap_auto_start"] = 1 - vim.api.nvim_command("nnoremap <buffer> <M-m> :MinimapToggle<CR>") - end, - cmd = { "MinimapToggle" }, - } - - -- Automatically set up your configuration after cloning packer.nvim - -- Put this at the end after all plugins - if packer_bootstrap then require("packer").sync() end -end) diff --git a/.config/nvim/lua/filetree.lua b/.config/nvim/lua/filetree.lua new file mode 100644 index 0000000..d252bad --- /dev/null +++ b/.config/nvim/lua/filetree.lua @@ -0,0 +1,2 @@ +require("nvim-tree").setup() + diff --git a/.config/nvim/lua/general.lua b/.config/nvim/lua/general.lua new file mode 100644 index 0000000..6732d38 --- /dev/null +++ b/.config/nvim/lua/general.lua @@ -0,0 +1,34 @@ +vim.opt.mouse = "a" +vim.opt.number = true +vim.opt.relativenumber = true +vim.opt.termguicolors = true +vim.opt.wrap = false +vim.opt.visualbell = true +vim.opt.undofile = true +vim.opt.backupcopy = "yes" +vim.opt.undolevels = 1000 +vim.opt.wrap = false + +-- Comment the following lines to disable whitespace characters +vim.opt.list = true +vim.opt.listchars:append("space:⋅") +vim.opt.listchars:append("eol:↴") +vim.opt.listchars:append("tab:-->") +vim.cmd [[colorscheme dracula]] + +vim.opt.spell = true +vim.opt.spelllang = "en" + +vim.g.markdown_fenced_languages = { + "ts=typescript"; + "xml=xml"; + "mermaid=mermaid"; +} + +if vim.fn.has("wsl") == 1 then + vim.api.nvim_create_autocmd("TextYankPost", { + group = vim.api.nvim_create_augroup("Yank", { clear = true }); + callback = function() vim.fn.system("clip.exe", vim.fn.getreg("\"")) end; + }) +end + diff --git a/.config/nvim/lua/keybinds.lua b/.config/nvim/lua/keybinds.lua new file mode 100644 index 0000000..49ea2e3 --- /dev/null +++ b/.config/nvim/lua/keybinds.lua @@ -0,0 +1,25 @@ +vim.g.mapleader = " " + +vim.api.nvim_set_keymap("n", "<Leader>n", ":NvimTreeToggle<CR>", + { noremap = true; silent = true }) + +vim.api.nvim_command("nnoremap <A-j> :m .+1<CR>==") +vim.api.nvim_command("nnoremap <A-k> :m .-2<CR>==") +vim.api.nvim_command("inoremap <A-k> <Esc>:m .-2<CR>==gi") +vim.api.nvim_command("inoremap <A-j> <Esc>:m .+1<CR>==gi") +vim.api.nvim_command("vnoremap <A-j> :m '>+1<CR>gv=gv") +vim.api.nvim_command("vnoremap <A-k> :m '<-2<CR>gv=gv") + +vim.api.nvim_command( + "nnoremap <buffer> <Leader><CR> :lua vim.lsp.buf.code_action()<CR>") +vim.api.nvim_command("nnoremap <buffer> <Leader>, :TroubleToggle<CR>") + +vim.api.nvim_set_keymap("n", "<Leader>f", ":Telescope find_files<CR>", + { noremap = true; silent = true }) +vim.api.nvim_set_keymap("n", "<Leader><TAB>", ":Telescope buffers<CR>", + { noremap = true; silent = true }) + +vim.keymap.set("n", "<Leader>[", require("ufo").openAllFolds) +vim.keymap.set("n", "<Leader>]", require("ufo").closeAllFolds) +vim.keymap.set("n", "<Leader>r", require("renamer").rename) + diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua new file mode 100644 index 0000000..8f728f0 --- /dev/null +++ b/.config/nvim/lua/lsp.lua @@ -0,0 +1,84 @@ +-- Setup nvim-cmp. +local cmp = require("cmp") + +cmp.setup({ + snippet = { + -- REQUIRED - you must specify a snippet engine + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. + end; + }; + window = { + completion = cmp.config.window.bordered(); + documentation = cmp.config.window.bordered(); + }; + mapping = cmp.mapping.preset.insert({ + ["<C-b>"] = cmp.mapping.scroll_docs(-4); + ["<C-f>"] = cmp.mapping.scroll_docs(4); + ["<C-Space>"] = cmp.mapping.complete(); + ["<C-e>"] = cmp.mapping.abort(); + ["<CR>"] = cmp.mapping.confirm({ select = true }); -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }); + sources = cmp.config.sources({ + { name = "nvim_lsp" }; + { name = "vsnip" }; -- For vsnip users. + }, { { name = "buffer" } }); +}) + +-- Set configuration for specific filetype. +cmp.setup.filetype("gitcommit", { + sources = cmp.config.sources({ + { name = "cmp_git" }; -- You can specify the `cmp_git` source if you were installed it. + }, { { name = "buffer" } }); +}) + +-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). +cmp.setup.cmdline("/", { + mapping = cmp.mapping.preset.cmdline(); + sources = { { name = "buffer" } }; +}) + +-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). +cmp.setup.cmdline(":", { + mapping = cmp.mapping.preset.cmdline(); + sources = cmp.config.sources({ { name = "path" } }, { { name = "cmdline" } }); +}) + +-- Setup lspconfig. +local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp + .protocol + .make_client_capabilities()) + +require("lspconfig")["denols"].setup { capabilities = capabilities } +local lspkind = require("lspkind") +cmp.setup { + formatting = { + format = lspkind.cmp_format({ + mode = "symbol"; -- show only symbol annotations + maxwidth = 50; -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) + + -- The function below will be called before any actual modifications from lspkind + -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30)) + before = function(entry, vim_item) return vim_item end; + }); + }; +} +local on_attach = function(client, bufnr) + vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") +end + +require("lspconfig")["tsserver"].setup { on_attach = on_attach } +require("lspconfig")["denols"].setup { + on_attach = on_attach; + init_options = { enable = true; unstable = true; config = "./deno.jsonc" }; + root_dir = vim.loop.cwd; +} + +vim.diagnostic.config({ + virtual_text = true; + signs = true; + underline = true; + update_in_insert = false; + severity_sort = true; +}) + diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua new file mode 100644 index 0000000..e7e42db --- /dev/null +++ b/.config/nvim/lua/plugins.lua @@ -0,0 +1,169 @@ +local PKGS = { + -- Plugin manager + { url = "https://github.com/savq/paq-nvim.git" }; + + -- Common + { url = "https://github.com/kyazdani42/nvim-web-devicons.git" }; + + { url = "https://github.com/kyazdani42/nvim-tree.lua.git" }; + { url = "https://github.com/nvim-telescope/telescope.nvim.git" }; + { url = "https://github.com/nvim-lua/plenary.nvim.git" }; + { url = "https://github.com/kevinhwang91/nvim-ufo.git" }; + { url = "https://github.com/kevinhwang91/promise-async.git" }; + { url = "https://github.com/iamcco/markdown-preview.nvim.git" }; + { url = "https://github.com/filipdutescu/renamer.nvim.git" }; + { url = "https://github.com/folke/which-key.nvim.git" }; + + -- Status line + { url = "https://github.com/akinsho/bufferline.nvim.git" }; + { url = "https://github.com/nvim-lualine/lualine.nvim.git" }; + + -- Code colors + { url = "https://github.com/lukas-reineke/indent-blankline.nvim.git" }; + { url = "https://github.com/nvim-treesitter/nvim-treesitter.git" }; + { url = "https://github.com/norcalli/nvim-colorizer.lua.git" }; + { url = "https://github.com/mracos/mermaid.vim.git" }; + + -- Themes + { url = "https://github.com/dracula/vim.git" }; + { url = "https://github.com/folke/tokyonight.nvim.git" }; + { url = "https://github.com/Mofiqul/vscode.nvim.git" }; + { url = "https://github.com/marko-cerovac/material.nvim.git" }; + { url = "https://github.com/sainnhe/sonokai.git" }; + { url = "https://github.com/navarasu/onedark.nvim.git" }; + { url = "https://github.com/Mofiqul/adwaita.nvim.git" }; + + -- LCOV Coverage + { url = "https://github.com/google/vim-coverage.git" }; + { url = "https://github.com/google/vim-maktaba.git" }; + + { url = "https://github.com/editorconfig/editorconfig-vim.git" }; + { url = "https://github.com/nathom/filetype.nvim.git" }; + { url = "https://github.com/wfxr/minimap.vim.git" }; + + -- LSP + { url = "https://github.com/neovim/nvim-lspconfig.git" }; + { url = "https://github.com/hrsh7th/nvim-cmp.git" }; + { url = "https://github.com/hrsh7th/cmp-nvim-lsp.git" }; + { url = "https://github.com/hrsh7th/cmp-buffer.git" }; + { url = "https://github.com/hrsh7th/cmp-path.git" }; + { url = "https://github.com/hrsh7th/cmp-cmdline.git" }; + { url = "https://github.com/hrsh7th/cmp-vsnip.git" }; + { url = "https://github.com/hrsh7th/vim-vsnip.git" }; + { url = "https://github.com/onsails/lspkind.nvim.git" }; + { url = "https://github.com/folke/trouble.nvim.git" }; + { url = "https://github.com/folke/lsp-colors.nvim.git" }; + + -- Dev container + { url = "https://codeberg.org/esensar/nvim-dev-container.git" }; + + -- Games + { url = "https://github.com/alec-gibson/nvim-tetris.git" }; +} + +local function clone_paq() + local path = vim.fn.stdpath("data") .. "/site/pack/paqs/start/paq-nvim" + if vim.fn.empty(vim.fn.glob(path)) > 0 then + vim.fn.system { + "git"; + "clone"; + "--depth=1"; + "https://github.com/savq/paq-nvim.git"; + path; + } + return true + else + return false + end +end +local function bootstrap_paq() + clone_paq() + -- Load Paq + vim.cmd("packadd paq-nvim") + local paq = require("paq") + -- Read and install packages + paq(PKGS) + paq.install() +end + +local function init_plugins() + local paq = require("paq") + paq(PKGS) + + vim.cmd [[highlight IndentBlanklineIndent1 guifg=#E06C75 gui=nocombine]] + vim.cmd [[highlight IndentBlanklineIndent2 guifg=#E5C07B gui=nocombine]] + vim.cmd [[highlight IndentBlanklineIndent3 guifg=#98C379 gui=nocombine]] + vim.cmd [[highlight IndentBlanklineIndent4 guifg=#56B6C2 gui=nocombine]] + vim.cmd [[highlight IndentBlanklineIndent5 guifg=#61AFEF gui=nocombine]] + vim.cmd [[highlight IndentBlanklineIndent6 guifg=#C678DD gui=nocombine]] + + require("indent_blankline").setup { + char_highlight_list = { + "IndentBlanklineIndent1"; + "IndentBlanklineIndent2"; + "IndentBlanklineIndent3"; + "IndentBlanklineIndent4"; + "IndentBlanklineIndent5"; + "IndentBlanklineIndent6"; + }; + show_end_of_line = true; + space_char_blankline = " "; + show_current_context = true; + show_current_context_start = true; + } + + require("colorizer").setup({ "*" }) + vim.g.minimap_auto_start = 1 + vim.g.minimap_highlight_range = 1 + vim.g.minimap_highlight_search = 1 + + require("ufo").setup({ + provider_selector = function(bufnr, filetype, buftype) + return { "treesitter"; "indent" } + end; + }); + + vim.o.foldcolumn = "1" + vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value + vim.o.foldlevelstart = 99 + vim.o.foldenable = true + + require("devcontainer").setup({}) + require("renamer").setup({ + -- The popup title, shown if `border` is true + title = "Rename"; + -- The padding around the popup content + padding = { top = 0; left = 0; bottom = 0; right = 0 }; + -- The minimum width of the popup + min_width = 15; + -- The maximum width of the popup + max_width = 45; + -- Whether or not to shown a border around the popup + border = true; + -- The characters which make up the border + border_chars = { "─"; "│"; "─"; "│"; "╭"; "╮"; "╯"; "╰" }; + -- Whether or not to highlight the current word references through LSP + show_refs = true; + -- Whether or not to add resulting changes to the quickfix list + with_qf_list = true; + -- Whether or not to enter the new name through the UI or Neovim's `input` + -- prompt + with_popup = true; + -- Custom handler to be run after successfully renaming the word. Receives + -- the LSP 'textDocument/rename' raw response as its parameter. + handler = nil; + }) + + require("which-key").setup({ + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }) + +end + +return { + clone_paq = clone_paq; + bootstrap_paq = bootstrap_paq; + init_plugins = init_plugins; +} diff --git a/.config/nvim/lua/statusline.lua b/.config/nvim/lua/statusline.lua new file mode 100644 index 0000000..3eef3c6 --- /dev/null +++ b/.config/nvim/lua/statusline.lua @@ -0,0 +1,31 @@ +require("bufferline").setup { options = { diagnostics = "nvim_lsp" } } + +require("lualine").setup { + options = { + icons_enabled = true; + theme = "auto"; + component_separators = { left = ""; right = "" }; + section_separators = { left = ""; right = "" }; + disabled_filetypes = {}; + always_divide_middle = true; + globalstatus = false; + }; + sections = { + lualine_a = { "mode" }; + lualine_b = { "branch"; "diff"; "diagnostics" }; + lualine_c = { "filename" }; + lualine_x = { "encoding"; "fileformat"; "filetype" }; + lualine_y = { "progress" }; + lualine_z = { "location" }; + }; + inactive_sections = { + lualine_a = {}; + lualine_b = {}; + lualine_c = { "filename" }; + lualine_x = { "location" }; + lualine_y = {}; + lualine_z = {}; + }; + extensions = {}; +} + |