diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index cc79982..b2e1a5d 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,4 +1,4 @@ -require'config.lazy' -require'base' -require'colors' -require'keymap' +require 'base' +require 'plugins' +require 'colors' +require 'keymap' diff --git a/.config/nvim/lua/colors.lua b/.config/nvim/lua/colors.lua index 30e2c02..442f664 100644 --- a/.config/nvim/lua/colors.lua +++ b/.config/nvim/lua/colors.lua @@ -27,4 +27,6 @@ for _, highlight in ipairs(highlights) do ) end +vim.api.nvim_set_hl(0, 'Comment', { italic=true }) + cmd [[let g:lightline = {'colorscheme': 'iceberg'}]] diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua deleted file mode 100644 index aa37eff..0000000 --- a/.config/nvim/lua/config/lazy.lua +++ /dev/null @@ -1,24 +0,0 @@ --- Bootstrap lazy.nvim -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) - if vim.v.shell_error ~= 0 then - vim.api.nvim_echo({ - { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, - { out, "WarningMsg" }, - { "\nPress any key to exit..." }, - }, true, {}) - vim.fn.getchar() - os.exit(1) - end -end -vim.opt.rtp:prepend(lazypath) - -require("lazy").setup({ - spec = { - { import = "plugins" }, - }, - install = { colorscheme = { "iceberg" } }, - checker = { enabled = true }, -}) diff --git a/.config/nvim/lua/lsp-config.lua b/.config/nvim/lua/lsp-config.lua index 1be020f..aadde6a 100644 --- a/.config/nvim/lua/lsp-config.lua +++ b/.config/nvim/lua/lsp-config.lua @@ -1,7 +1,7 @@ local lspconfig = require('lspconfig') local autocmd = require'utils'.autocmd -local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) +local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities()) local function on_attach(client, bufnr) local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index dbe9027..c013cc4 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -1,140 +1,109 @@ -return { - { "williamboman/mason.nvim", opts = {} }, - { "williamboman/mason-lspconfig", opts = {} }, - { "neovim/nvim-lspconfig", config = function() require("lsp-config") end }, - - "cocopon/iceberg.vim", - - "tpope/vim-surround", - "tpope/vim-abolish", - "tpope/vim-commentary", - "tpope/vim-eunuch", - "tpope/vim-fugitive", - - "junegunn/vim-peekaboo", - "junegunn/vim-slash", - - "AndrewRadev/splitjoin.vim", - - "pbrisbin/vim-mkdir", - - { "nacro90/numb.nvim", opts = {} }, - - { - "Raimondi/delimitMate", - init = function() - vim.g.delimitMate_expand_space = 1 - vim.g.delimitMate_expand_cr = 2 - --vim.g.delimitMate_autoclose = 0 - end - }, - - { - "winston0410/range-highlight.nvim", - opts = {}, - dependencies = { "winston0410/cmd-parser.nvim" }, - }, - - "editorconfig/editorconfig-vim", - "christoomey/vim-tmux-navigator", - - -- Syntax-y things - - { - "nvim-treesitter/nvim-treesitter", - config = function() - require'nvim-treesitter.configs'.setup { - highlight = { enable = true }, - } - end, - }, - - { - "AckslD/nvim-FeMaco.lua", - opts = { - post_open_float = function(winnr) - vim.api.nvim_win_set_option(winnr, "winblend", 10) - end - }, - }, - - { - "L3MON4D3/LuaSnip", - dependencies = { - "rafamadriz/friendly-snippets", - }, - }, - - { - -- TODO: figure this out - "hrsh7th/nvim-cmp", - event = "InsertEnter", - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "saadparwaiz1/cmp_luasnip", - "petertriho/cmp-git", - "lukas-reineke/cmp-rg", - }, - config = function() - require("completion") - end, - }, - - -- UI - { - "nvim-telescope/telescope.nvim", - dependencies = { - "nvim-lua/popup.nvim", - "nvim-lua/plenary.nvim", - }, - }, - { - "junegunn/fzf.vim", - dependencies = "junegunn/fzf" - }, - - { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - opts = { - window = { position = "right" }, - }, - config = function(_, opts) - -- Adding rules from plugin - opts.nesting_rules = require("neotree-file-nesting-config").nesting_rules - require("neo-tree").setup(opts) - end, - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", - "saifulapm/neotree-file-nesting-config", - }, - }, - { - "lewis6991/gitsigns.nvim", - opts = {}, - dependencies = { "nvim-lua/plenary.nvim" }, - }, - { - "romgrk/barbar.nvim", - dependencies = { "kyazdani42/nvim-web-devicons" }, - }, - { - "itchyny/lightline.vim", - init = function() - vim.g.lightline = { - colorscheme = "iceberg", - } - end, - }, - - ----TODO: - --{ - -- "nvim-focus/focus.nvim", - -- opts = {}, - --}, +vim.pack.add({ + -- common deps + "https://github.com/nvim-lua/popup.nvim", + "https://github.com/nvim-lua/plenary.nvim", + "https://github.com/nvim-tree/nvim-web-devicons", + + -- colors + "https://github.com/cocopon/iceberg.vim", + + "https://github.com/tpope/vim-surround", + "https://github.com/tpope/vim-abolish", + "https://github.com/tpope/vim-commentary", + "https://github.com/tpope/vim-eunuch", + "https://github.com/tpope/vim-fugitive", + + "https://github.com/junegunn/vim-peekaboo", + "https://github.com/junegunn/vim-slash", + + "https://github.com/AndrewRadev/splitjoin.vim", + + "https://github.com/pbrisbin/vim-mkdir", + + "https://github.com/nacro90/numb.nvim", + + "https://github.com/Raimondi/delimitMate", + + "https://github.com/editorconfig/editorconfig-vim", + + "https://github.com/christoomey/vim-tmux-navigator", + + + "https://github.com/nvim-telescope/telescope.nvim", + + "https://github.com/junegunn/fzf", + "https://github.com/junegunn/fzf.vim", + + -- neo-tree deps + "https://github.com/MunifTanjim/nui.nvim", + "https://github.com/saifulapm/neotree-file-nesting-config", + + { + src = "https://github.com/nvim-neo-tree/neo-tree.nvim", + version = vim.version.range("3"), + }, + + "https://github.com/nvim-treesitter/nvim-treesitter", + + "https://github.com/lewis6991/gitsigns.nvim", + + "https://github.com/romgrk/barbar.nvim", + "https://github.com/itchyny/lightline.vim", + + "https://github.com/winston0410/cmd-parser.nvim", + "https://github.com/winston0410/range-highlight.nvim", + + "https://github.com/williamboman/mason.nvim", + "https://github.com/williamboman/mason-lspconfig", + "https://github.com/neovim/nvim-lspconfig", + + + "https://github.com/L3MON4D3/LuaSnip", + "https://github.com/rafamadriz/friendly-snippets", + + "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/petertriho/cmp-git", + "https://github.com/lukas-reineke/cmp-rg", + "https://github.com/hrsh7th/nvim-cmp", +}) + +--treesitter +vim.api.nvim_create_autocmd('FileType', { + pattern = { '' }, + callback = function() vim.treesitter.start() end, +}) + +-- neo-tree +require('neo-tree').setup({ + window = { + position = "right", + }, + nesting_rules = require("neotree-file-nesting-config").nesting_rules, +}) + +--delimitMate +vim.g.delimitMate_expand_space = 1 +vim.g.delimitMate_expand_cr = 2 +--vim.g.delimitMate_autoclose = 0 + +-- lightline +vim.g.lightline = { + colorscheme = "iceberg", } + +-- lsp + +require("completion") + +require("mason").setup() +require("mason-lspconfig").setup() + +vim.lsp.config('*', { + root_markers = { '.git' }, +}) + +vim.lsp.enable('html') +vim.lsp.enable('ts_ls')