diff --git a/init.lua b/init.lua index ed50b69d7f3..5e007877fe0 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,7 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.o` @@ -102,7 +102,7 @@ vim.g.have_nerd_font = false vim.o.number = true -- You can also add relative line numbers, to help with jumping. -- Experiment for yourself to see if you like it! --- vim.o.relativenumber = true +vim.o.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! vim.o.mouse = 'a' @@ -119,6 +119,12 @@ vim.schedule(function() vim.o.clipboard = 'unnamedplus' end) -- Enable break indent vim.o.breakindent = true +-- Expand tabs to 4 spaces, enable smartinden +vim.opt.expandtab = true +vim.opt.smartindent = true +vim.opt.tabstop = 2 +vim.opt.shiftwidth = 2 + -- Enable undo/redo changes even after closing and reopening a file vim.o.undofile = true @@ -164,6 +170,9 @@ vim.o.scrolloff = 10 -- See `:help 'confirm'` vim.o.confirm = true +-- Allow loading local .nvim.lua files +vim.o.exrc = true + -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` @@ -257,7 +266,24 @@ rtp:prepend(lazypath) require('lazy').setup({ -- NOTE: Plugins can be added via a link or github org/name. To run setup automatically, use `opts = {}` { 'NMAC427/guess-indent.nvim', opts = {} }, - + { + 'christoomey/vim-tmux-navigator', + cmd = { + 'TmuxNavigateLeft', + 'TmuxNavigateDown', + 'TmuxNavigateUp', + 'TmuxNavigateRight', + 'TmuxNavigatePrevious', + 'TmuxNavigatorProcessList', + }, + keys = { + { '', 'TmuxNavigateLeft' }, + { '', 'TmuxNavigateDown' }, + { '', 'TmuxNavigateUp' }, + { '', 'TmuxNavigateRight' }, + { '', 'TmuxNavigatePrevious' }, + }, + }, -- Alternatively, use `config = function() ... end` for full control over the configuration. -- If you prefer to call `setup` explicitly, use: -- { @@ -600,9 +626,10 @@ require('lazy').setup({ -- See `:help lsp-config` for information about keys and how to configure ---@type table local servers = { - -- clangd = {}, + clangd = {}, + cpptools = {}, -- gopls = {}, - -- pyright = {}, + pyright = {}, -- rust_analyzer = {}, -- -- Some languages (like typescript) have entire language plugins that can be useful: @@ -684,7 +711,7 @@ require('lazy').setup({ -- Disable "format_on_save lsp_fallback" for languages that don't -- have a well standardized coding style. You can add additional -- languages here or re-enable it for the disabled ones. - local disable_filetypes = { c = true, cpp = true } + local disable_filetypes = {} if disable_filetypes[vim.bo[bufnr].filetype] then return nil else @@ -697,8 +724,9 @@ require('lazy').setup({ formatters_by_ft = { lua = { 'stylua' }, -- Conform can also run multiple formatters sequentially - -- python = { "isort", "black" }, - -- + python = { 'isort', 'black' }, + cpp = { 'clang-format' }, + c = { 'clang-format' }, -- You can use 'stop_after_first' to run the first available formatter from the list -- javascript = { "prettierd", "prettier", stop_after_first = true }, }, @@ -874,7 +902,28 @@ require('lazy').setup({ branch = 'main', -- [[ Configure Treesitter ]] See `:help nvim-treesitter-intro` config = function() - local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } + local parsers = { + 'bash', + 'c', + 'cpp', + 'make', + 'cmake', + 'python', + 'diff', + 'json', + 'html', + 'xml', + 'yaml', + 'toml', + 'lua', + 'luadoc', + 'markdown', + 'markdown_inline', + 'query', + 'vim', + 'vimdoc', + } + require('nvim-treesitter').install(parsers) vim.api.nvim_create_autocmd('FileType', { callback = function(args) @@ -909,18 +958,18 @@ require('lazy').setup({ -- Here are some example plugins that I've included in the Kickstart repository. -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- - -- require 'kickstart.plugins.debug', - -- require 'kickstart.plugins.indent_line', - -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended keymaps + require 'kickstart.plugins.debug', + require 'kickstart.plugins.indent_line', + require 'kickstart.plugins.lint', + require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.neo-tree', + require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index b3ddcfdd3aa..a20547614f4 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -5,4 +5,26 @@ ---@module 'lazy' ---@type LazySpec -return {} +return { + 'AckslD/nvim-neoclip.lua', + dependencies = { + { 'kkharji/sqlite.lua', module = 'sqlite' }, + { 'nvim-telescope/telescope.nvim' }, + }, + config = function() + require('neoclip').setup { + -- Optional: keep unnamed + system clipboard in sync via neoclip + default_register = { '"', '+' }, + + on_select = { + move_to_front = true, + close_telescope = true, + }, + on_paste = { + set_reg = true, -- <== update registers when using paste keys + move_to_front = true, + close_telescope = true, + }, + } + end, +} diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index af8d4495650..137fe2e68c4 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -19,6 +19,11 @@ return { ---@type neotree.Config opts = { filesystem = { + filtered_items = { + visible = true, + hide_dotfiles = false, + hide_gitignored = true, + }, window = { mappings = { ['\\'] = 'close_window',