diff --git a/.gitignore b/.gitignore index 005b535b606..8a192cab54d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,3 @@ test.sh nvim spell/ -lazy-lock.json diff --git a/init.lua b/init.lua index b98ffc6198a..0a7c49772bc 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.opt.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! vim.o.mouse = 'a' @@ -114,9 +114,9 @@ vim.o.showmode = false -- Schedule the setting after `UiEnter` because it can increase startup-time. -- Remove this option if you want your OS clipboard to remain independent. -- See `:help 'clipboard'` -vim.schedule(function() - vim.o.clipboard = 'unnamedplus' -end) +-- vim.schedule(function() +-- vim.opt.clipboard = 'unnamedplus' +-- end) -- Enable break indent vim.o.breakindent = true @@ -347,6 +347,7 @@ require('lazy').setup({ { 's', group = '[S]earch' }, { 't', group = '[T]oggle' }, { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, + { 'm', group = '[M]arks' }, }, }, }, @@ -671,10 +672,53 @@ require('lazy').setup({ -- - settings (table): Override the default settings passed when initializing the server. -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { - -- clangd = {}, - -- gopls = {}, + clangd = {}, + gopls = {}, + omnisharp = { + root_dir = function() + return vim.loop.cwd() + end, + settings = { + FormattingOptions = { + -- Enables support for reading code style, naming convention and analyzer + -- settings from .editorconfig. + EnableEditorConfigSupport = true, + -- Specifies whether 'using' directives should be grouped and sorted during + -- document formatting. + OrganizeImports = nil, + }, + MsBuild = { + -- If true, MSBuild project system will only load projects for files that + -- were opened in the editor. This setting is useful for big C# codebases + -- and allows for faster initialization of code navigation features only + -- for projects that are relevant to code that is being edited. With this + -- setting enabled OmniSharp may load fewer projects and may thus display + -- incomplete reference lists for symbols. + LoadProjectsOnDemand = nil, + }, + RoslynExtensionsOptions = { + -- Enables support for roslyn analyzers, code fixes and rulesets. + EnableAnalyzersSupport = true, + -- Enables support for showing unimported types and unimported extension + -- methods in completion lists. When committed, the appropriate using + -- directive will be added at the top of the current file. This option can + -- have a negative impact on initial completion responsiveness, + -- particularly for the first few completion sessions after opening a + -- solution. + EnableImportCompletion = true, + -- Only run analyzers against open files when 'enableRoslynAnalyzers' is + -- true + AnalyzeOpenDocumentsOnly = true, + }, + Sdk = { + -- Specifies whether to include preview versions of the .NET SDK when + -- determining which version to use for project loading. + IncludePrereleases = true, + }, + }, + }, -- pyright = {}, - -- rust_analyzer = {}, + rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- -- Some languages (like typescript) have entire language plugins that can be useful: @@ -881,7 +925,7 @@ require('lazy').setup({ -- change the command in the config to whatever the name of that colorscheme is. -- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. - 'folke/tokyonight.nvim', + 'rose-pine/neovim', priority = 1000, -- Make sure to load this before all the other start plugins. config = function() ---@diagnostic disable-next-line: missing-fields @@ -984,7 +1028,7 @@ require('lazy').setup({ -- 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! @@ -1012,5 +1056,65 @@ require('lazy').setup({ }, }) +-- Harpoon keybindings +local harpoon = require 'harpoon' + +-- REQUIRED +harpoon:setup() +-- REQUIRED + +vim.keymap.set('n', 'ma', function() + harpoon:list():add() +end, { desc = '[M]ark [A]dd file' }) + +vim.keymap.set('n', '', function() + harpoon.ui:toggle_quick_menu(harpoon:list()) +end, { desc = '[M]ark [M]enu' }) + +vim.keymap.set('n', 'mn', function() + harpoon:list():next() +end, { desc = '[M]ark [N]ext' }) + +vim.keymap.set('n', 'mp', function() + harpoon:list():prev() +end, { desc = '[M]ark [P]revious' }) + +vim.keymap.set('n', '', function() + harpoon:list():select(1) +end) +vim.keymap.set('n', '', function() + harpoon:list():select(2) +end) +vim.keymap.set('n', '', function() + harpoon:list():select(3) +end) +vim.keymap.set('n', '', function() + harpoon:list():select(4) +end) + +-- basic telescope configuration +local conf = require('telescope.config').values +local function toggle_telescope(harpoon_files) + local file_paths = {} + for _, item in ipairs(harpoon_files.items) do + table.insert(file_paths, item.value) + end + + require('telescope.pickers') + .new({}, { + prompt_title = 'Harpoon', + finder = require('telescope.finders').new_table { + results = file_paths, + }, + previewer = conf.file_previewer {}, + sorter = conf.generic_sorter {}, + }) + :find() +end + +vim.keymap.set('n', 'mt', function() + toggle_telescope(harpoon:list()) +end, { desc = 'Open harpoon window' }) + -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 00000000000..231236b15f5 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,33 @@ +{ + "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "conform.nvim": { "branch": "master", "commit": "70019124aa4f2e6838be9fbd2007f6d13b27a96d" }, + "copilot.vim": { "branch": "release", "commit": "87038123804796ca7af20d1b71c3428d858a9124" }, + "fidget.nvim": { "branch": "main", "commit": "a0abbf18084b77d28bc70e24752e4f4fd54aea17" }, + "gitsigns.nvim": { "branch": "main", "commit": "68114837e81ca16d06514c3a997c9102d1b25c15" }, + "harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" }, + "lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" }, + "lazydev.nvim": { "branch": "main", "commit": "8620f82ee3f59ff2187647167b6b47387a13a018" }, + "luvit-meta": { "branch": "main", "commit": "55709f183b0742a7e4f47688c284f81148ad4dc0" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "97d9f1d3ad205dece6bcafd1d71cf1507608f3c7" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "mini.nvim": { "branch": "main", "commit": "890db26e37bb28d8a95f05570dd0d9fa757b698b" }, + "neovim": { "branch": "main", "commit": "106f05aeab8277e97eda9649271b33f9f12d8db4" }, + "nvim-cmp": { "branch": "main", "commit": "8c82d0bd31299dbff7f8e780f5e06d2283de9678" }, + "nvim-lspconfig": { "branch": "master", "commit": "88157521e890fe7fdf18bee22438875edd6300a6" }, + "nvim-treesitter": { "branch": "master", "commit": "306dd6e9dc806db1d79568d26e1c9b6c98b95fbc" }, + "nvim-web-devicons": { "branch": "master", "commit": "aafa5c187a15701a7299a392b907ec15d9a7075f" }, + "oil.nvim": { "branch": "master", "commit": "7041528bdedb350ad66e650684deec8456e053cc" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, + "undotree": { "branch": "master", "commit": "2556c6800b210b2096b55b66e74b4cc1d9ebbe4f" }, + "vim-fugitive": { "branch": "master", "commit": "174230d6a7f2df94705a7ffd8d5413e27ec10a80" }, + "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, + "which-key.nvim": { "branch": "main", "commit": "1f8d414f61e0b05958c342df9b6a4c89ce268766" } +} diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8d7a..29d3a75bf67 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,25 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return {} +return { + 'tpope/vim-fugitive', + { + 'mbbill/undotree', + config = function() + vim.keymap.set('n', '', vim.cmd.UndotreeToggle, { desc = 'Toggle Undotree' }) + end, + }, + { + 'stevearc/oil.nvim', + opts = {}, + dependencies = { 'nvim-tree/nvim-web-devicons' }, -- use if prefer nvim-web-devicons + }, + { + 'ThePrimeagen/harpoon', + branch = 'harpoon2', + config = function() + require('harpoon').setup() + end, + }, + 'github/copilot.vim', +}