diff --git a/nvim/.config/nvim/after/plugin/telescope.lua b/nvim/.config/nvim/after/plugin/telescope.lua deleted file mode 100644 index d9ef263..0000000 --- a/nvim/.config/nvim/after/plugin/telescope.lua +++ /dev/null @@ -1,20 +0,0 @@ -pcall(require('telescope').load_extension, 'fzf') - -local builtin = require('telescope.builtin') -vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) -vim.keymap.set('n', '?', builtin.oldfiles, { desc = '[?] Find recently opened buffers' }) -vim.keymap.set('n', '/', function() - builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown { previewer = false }) -end, { desc = '[?] Find recently opened buffers' }) - -vim.keymap.set('n', 'gf', builtin.git_files, { desc = '[G]it [f]iles' }) -vim.keymap.set('n', 'gs', builtin.git_status, { desc = '[G]it [s]tatus' }) -vim.keymap.set('n', 'ff', builtin.find_files, { desc = '[F]ind [f]iles' }) -vim.keymap.set('n', 'fg', builtin.live_grep, { desc = '[F]ind [g]rep' }) -vim.keymap.set('n', 'fw', builtin.grep_string, { desc = '[F]ind [w]ord' }) -vim.keymap.set('n', 'fh', builtin.help_tags, { desc = '[F]ind [h]elp (tags)' }) -vim.keymap.set('n', 'fd', builtin.diagnostics, { desc = '[F]ind [d]iagnostics' }) - -vim.keymap.set('n', 'fF', function() - builtin.find_files { hidden = true } -end, { desc = '[F]find [F]iles (with hidden)' }) diff --git a/nvim/.config/nvim/after/plugin/treesitter.lua b/nvim/.config/nvim/after/plugin/treesitter.lua index 7efe284..dbab0e9 100644 --- a/nvim/.config/nvim/after/plugin/treesitter.lua +++ b/nvim/.config/nvim/after/plugin/treesitter.lua @@ -2,13 +2,12 @@ local org = require('orgmode') org.setup_ts_grammar() require('nvim-treesitter.configs').setup { - ensure_installed = { 'c', 'cpp', 'go', 'haskell', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim' }, + ensure_installed = { 'c', 'cpp', 'go', 'haskell', 'lua', 'org', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim' }, auto_install = false, highlight = { enable = true, additional_vim_regex_highlighting = { 'org' }, }, - ensure_installed = { 'org' }, -- Or run :TSUpdate org indent = { enable = true }, incremental_selection = { enable = true, diff --git a/nvim/.config/nvim/lua/lupan/init.lua b/nvim/.config/nvim/lua/lupan/init.lua index 0ebe9fd..5dacb1a 100644 --- a/nvim/.config/nvim/lua/lupan/init.lua +++ b/nvim/.config/nvim/lua/lupan/init.lua @@ -2,4 +2,4 @@ require("lupan.remap") require("lupan.lazy") require("lupan.options") require("lupan.autocmd") -require("lupan.plugins") +require('lazy').setup('plugins') diff --git a/nvim/.config/nvim/lua/lupan/plugins.lua b/nvim/.config/nvim/lua/lupan/plugins.lua index cfbebba..469df24 100644 --- a/nvim/.config/nvim/lua/lupan/plugins.lua +++ b/nvim/.config/nvim/lua/lupan/plugins.lua @@ -1,150 +1 @@ -require('lazy').setup({ - -- Fuzzy finder - { - 'nvim-telescope/telescope.nvim', - branch = '0.1.x', - dependencies = { - 'nvim-lua/plenary.nvim' } - }, - - -- Colorscheme - { - 'neanias/everforest-nvim', - priority = 1000, - lazy = false, - config = function() - require("everforest").setup({ - background = 'hard', - }) - vim.cmd.colorscheme 'everforest' - end - }, - - { - 'nvim-treesitter/nvim-treesitter', - dependencies = { - 'nvim-treesitter/nvim-treesitter-textobjects', - 'nvim-orgmode/orgmode', -- as configured together - }, - build = - ':TSUpdate' - }, - - { - -- Statusline (see `:help lualine.txt`) - 'nvim-lualine/lualine.nvim', - opts = { - options = { - icons_enabled = false, - theme = 'everforest', - component_separators = '|', - section_separators = '', - }, - }, - }, - - { - -- Indentation guides (see `:help indent_blankline.txt`) - 'lukas-reineke/indent-blankline.nvim', - opts = { - char = '┊', - show_trailing_blankline_indent = false, - }, - }, - - -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, - - 'norcalli/nvim-colorizer.lua', - - -- Undo browsing - 'mbbill/undotree', - - -- Git - 'tpope/vim-fugitive', - - -- Tabstops autodetected - 'tpope/vim-sleuth', - - { - -- LSP Configuration & Plugins - 'neovim/nvim-lspconfig', - dependencies = { - -- Automatically install LSPs to stdpath for neovim - { 'williamboman/mason.nvim', config = true }, - 'williamboman/mason-lspconfig.nvim', - - -- Useful status updates for LSP - { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, - - -- Additional lua configuration, makes nvim stuff amazing! - 'folke/neodev.nvim', - }, - }, - - { - -- Autocompletion - 'hrsh7th/nvim-cmp', - dependencies = { - -- Snippet Engine & its associated nvim-cmp source - 'L3MON4D3/LuaSnip', - 'saadparwaiz1/cmp_luasnip', - - -- Adds LSP completion capabilities - 'hrsh7th/cmp-nvim-lsp', - - -- Adds a number of user-friendly snippets - 'rafamadriz/friendly-snippets', - }, - }, - - -- Show pending keybinds - { 'folke/which-key.nvim', opts = {} }, - - { - -- Adds git releated signs to the gutter, as well as utilities for managing changes - 'lewis6991/gitsigns.nvim', - opts = { - -- See `:help gitsigns.txt` - signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '_' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - }, - on_attach = function(bufnr) - vim.keymap.set('n', 'gp', require('gitsigns').prev_hunk, - { buffer = bufnr, desc = '[G]o to [P]revious Hunk' }) - vim.keymap.set('n', 'gn', require('gitsigns').next_hunk, { buffer = bufnr, desc = '[G]o to [N]ext Hunk' }) - vim.keymap.set('n', 'ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' }) - vim.keymap.set('n', 'sh', require('gitsigns').stage_hunk, { buffer = bufnr, desc = '[S]tage [H]unk' }) - end, - }, - }, - - { - "kylechui/nvim-surround", - version = "*", -- Use for stability; omit to use `main` branch for the latest features - event = "VeryLazy", - config = function() - require("nvim-surround").setup({}) - end - }, - - { - 'akinsho/toggleterm.nvim', - version = "*", - opts = { - direction = "float", - open_mapping = [[]], - } - }, - - 'ggandor/lightspeed.nvim', - - { - 'ThePrimeagen/harpoon', - dependencies = { 'nvim-lua/plenary.nvim' }, - } -}) +-- require('lazy').setup('plugins') diff --git a/nvim/.config/nvim/lua/lupan/remap.lua b/nvim/.config/nvim/lua/lupan/remap.lua index e3114e3..3b0f015 100644 --- a/nvim/.config/nvim/lua/lupan/remap.lua +++ b/nvim/.config/nvim/lua/lupan/remap.lua @@ -17,6 +17,26 @@ key("n", "dt", ":Lexplore 30", { desc = "[D]isplay directory [t]oggl key("n", "ct", ":ColorizerToggle", { desc = "[C]olorizer [t]oggle" }) key("n", "ut", ":UndotreeToggle", { desc = "[U]undotree [t]oggle" }) +-- telescope + +key('n', '', 'Telescope buffers', { desc = '[ ] Find existing buffers' }) +key('n', '?', 'Telescope oldfiles', { desc = '[?] Find recently opened buffers' }) +key('n', '/', function() + require('telescope.builtin').current_buffer_fuzzy_find(require("telescope.themes").get_dropdown { previewer = false }) +end, { desc = '[/] Find in current buffer' }) + +key('n', 'gf', 'Telescope git_files', { desc = '[G]it [f]iles' }) +key('n', 'gs', 'Telescope git_status', { desc = '[G]it [s]tatus' }) +key('n', 'ff', 'Telescope find_files', { desc = '[F]ind [f]iles' }) +key('n', 'fg', 'Telescope live_grep', { desc = '[F]ind [g]rep' }) +key('n', 'fw', 'Telescope grep_string', { desc = '[F]ind [w]ord' }) +key('n', 'fh', 'Telescope help_tags', { desc = '[F]ind [h]elp (tags)' }) +key('n', 'fd', 'Telescope diagnostics', { desc = '[F]ind [d]iagnostics' }) + +key('n', 'fF', function() + require('telescope.builtin').find_files { hidden = true } +end, { desc = '[F]ind [F]iles (with hidden)' }) + -- Diagnostic keymaps key('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) key('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) diff --git a/nvim/.config/nvim/lua/plugins/init.lua b/nvim/.config/nvim/lua/plugins/init.lua new file mode 100644 index 0000000..4384d63 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/init.lua @@ -0,0 +1,165 @@ +return { + -- Fuzzy finder + { + 'nvim-telescope/telescope.nvim', + branch = '0.1.x', + dependencies = { + 'nvim-lua/plenary.nvim' }, + config = function() + pcall(require('telescope').load_extension, 'fzf') + end, + cmd = 'Telescope', + }, + + -- Colorscheme + { + 'neanias/everforest-nvim', + priority = 1000, + lazy = false, + config = function() + require("everforest").setup({ + background = 'hard', + }) + vim.cmd.colorscheme 'everforest' + end + }, + + { + 'nvim-treesitter/nvim-treesitter', + dependencies = { + 'nvim-treesitter/nvim-treesitter-textobjects', + 'nvim-orgmode/orgmode', -- as configured together + }, + build = + ':TSUpdate' + }, + + { + -- Statusline (see `:help lualine.txt`) + 'nvim-lualine/lualine.nvim', + opts = { + options = { + icons_enabled = false, + theme = 'everforest', + component_separators = '|', + section_separators = '', + }, + }, + }, + + { + -- Indentation guides (see `:help indent_blankline.txt`) + 'lukas-reineke/indent-blankline.nvim', + opts = { + char = '┊', + show_trailing_blankline_indent = false, + }, + }, + + -- "gc" to comment visual regions/lines + { + 'numToStr/Comment.nvim', + opts = {} + }, + + { + 'norcalli/nvim-colorizer.lua', + cmd = 'ColorizerToggle' + }, + + -- Undo browsing + 'mbbill/undotree', + + -- Git + 'tpope/vim-fugitive', + + -- Tabstops autodetected + 'tpope/vim-sleuth', + + { + -- LSP Configuration & Plugins + 'neovim/nvim-lspconfig', + dependencies = { + -- Automatically install LSPs to stdpath for neovim + { 'williamboman/mason.nvim', config = true }, + 'williamboman/mason-lspconfig.nvim', + + -- Useful status updates for LSP + { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, + + -- Additional lua configuration, makes nvim stuff amazing! + 'folke/neodev.nvim', + }, + }, + + { + -- Autocompletion + 'hrsh7th/nvim-cmp', + dependencies = { + -- Snippet Engine & its associated nvim-cmp source + 'L3MON4D3/LuaSnip', + 'saadparwaiz1/cmp_luasnip', + + -- Adds LSP completion capabilities + 'hrsh7th/cmp-nvim-lsp', + + -- Adds a number of user-friendly snippets + 'rafamadriz/friendly-snippets', + }, + }, + + -- Show pending keybinds + { 'folke/which-key.nvim', opts = {} }, + + { + -- Adds git releated signs to the gutter, as well as utilities for managing changes + 'lewis6991/gitsigns.nvim', + opts = { + -- See `:help gitsigns.txt` + signs = { + add = { text = '+' }, + change = { text = '~' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + }, + on_attach = function(bufnr) + vim.keymap.set('n', 'gp', require('gitsigns').prev_hunk, + { buffer = bufnr, desc = '[G]o to [P]revious Hunk' }) + vim.keymap.set('n', 'gn', require('gitsigns').next_hunk, + { buffer = bufnr, desc = '[G]o to [N]ext Hunk' }) + vim.keymap.set('n', 'ph', require('gitsigns').preview_hunk, + { buffer = bufnr, desc = '[P]review [H]unk' }) + vim.keymap.set('n', 'sh', require('gitsigns').stage_hunk, + { buffer = bufnr, desc = '[S]tage [H]unk' }) + end, + }, + }, + + { + "kylechui/nvim-surround", + version = "*", -- Use for stability; omit to use `main` branch for the latest features + event = "VeryLazy", + config = function() + require("nvim-surround").setup({}) + end + }, + + { + 'akinsho/toggleterm.nvim', + keys = { '', 'ToggleTerm', desc = 'Toggle term' }, + version = "*", + opts = { + direction = "float", + open_mapping = [[]], + } + }, + + 'ggandor/lightspeed.nvim', + + { + 'ThePrimeagen/harpoon', + dependencies = { 'nvim-lua/plenary.nvim' }, + lazy = true, + } +}