@@ -102,7 +102,7 @@ vim.g.have_nerd_font = true
102102vim .opt .number = true
103103-- You can also add relative line numbers, to help with jumping.
104104-- Experiment for yourself to see if you like it!
105- -- vim.opt.relativenumber = true
105+ vim .opt .relativenumber = true
106106
107107-- Enable mouse mode, can be useful for resizing splits for example!
108108vim .opt .mouse = ' a'
@@ -190,6 +190,12 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
190190vim .keymap .set (' n' , ' <C-j>' , ' <C-w><C-j>' , { desc = ' Move focus to the lower window' })
191191vim .keymap .set (' n' , ' <C-k>' , ' <C-w><C-k>' , { desc = ' Move focus to the upper window' })
192192
193+ if vim .lsp .inlay_hint then
194+ vim .keymap .set (' n' , ' <leader>ih' , function ()
195+ vim .lsp .inlay_hint .enable (not vim .lsp .inlay_hint .is_enabled {})
196+ end , { desc = ' Toggle [I]nlay [H]ints' })
197+ end
198+
193199-- [[ Basic Autocommands ]]
194200-- See `:help lua-guide-autocommands`
195201
@@ -231,6 +237,10 @@ require('lazy').setup({
231237 -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
232238 ' tpope/vim-sleuth' , -- Detect tabstop and shiftwidth automatically
233239
240+ -- Git related plugins
241+ ' tpope/vim-fugitive' ,
242+ ' tpope/vim-rhubarb' ,
243+
234244 -- NOTE: Plugins can also be added by using a table,
235245 -- with the first argument being the link and the following
236246 -- keys can be used to configure plugin behavior/loading/etc.
@@ -328,6 +338,14 @@ require('lazy').setup({
328338 { ' <leader>h' , group = ' Git [H]unk' , mode = { ' n' , ' v' } },
329339 },
330340 },
341+ require (' which-key' ).add {
342+ { ' <leader>c' , group = ' [C]ode' },
343+ { ' <leader>d' , group = ' [D]ocument]' },
344+ { ' <leader>r' , group = ' [R]ename' },
345+ { ' <leader>s' , group = ' [S]earch' },
346+ { ' <leader>w' , group = ' [W]orkspace' },
347+ }
348+ end ,
331349 },
332350
333351 -- NOTE: Plugins can specify dependencies.
@@ -357,6 +375,7 @@ require('lazy').setup({
357375 end ,
358376 },
359377 { ' nvim-telescope/telescope-ui-select.nvim' },
378+ { ' nvim-telescope/telescope-file-browser.nvim' },
360379
361380 -- Useful for getting pretty icons, but requires a Nerd Font.
362381 { ' nvim-tree/nvim-web-devicons' , enabled = vim .g .have_nerd_font },
@@ -403,6 +422,7 @@ require('lazy').setup({
403422 -- Enable Telescope extensions if they are installed
404423 pcall (require (' telescope' ).load_extension , ' fzf' )
405424 pcall (require (' telescope' ).load_extension , ' ui-select' )
425+ pcall (require (' telescope' ).load_extension , ' file_browser' )
406426
407427 -- See `:help telescope.builtin`
408428 local builtin = require ' telescope.builtin'
@@ -416,6 +436,7 @@ require('lazy').setup({
416436 vim .keymap .set (' n' , ' <leader>sr' , builtin .resume , { desc = ' [S]earch [R]esume' })
417437 vim .keymap .set (' n' , ' <leader>s.' , builtin .oldfiles , { desc = ' [S]earch Recent Files ("." for repeat)' })
418438 vim .keymap .set (' n' , ' <leader><leader>' , builtin .buffers , { desc = ' [ ] Find existing buffers' })
439+ vim .keymap .set (' n' , ' -' , ' :Telescope file_browser<CR>' , { desc = ' Search the file browser [-]' })
419440
420441 -- Slightly advanced example of overriding default behavior and theme
421442 vim .keymap .set (' n' , ' <leader>/' , function ()
@@ -459,6 +480,9 @@ require('lazy').setup({
459480 {
460481 -- Main LSP Configuration
461482 ' neovim/nvim-lspconfig' ,
483+ opts = {
484+ inlay_hints = { enabled = true },
485+ },
462486 dependencies = {
463487 -- Automatically install LSPs and related tools to stdpath for Neovim
464488 { ' williamboman/mason.nvim' , config = true }, -- NOTE: Must be loaded before dependants
@@ -615,16 +639,78 @@ require('lazy').setup({
615639 -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
616640 local servers = {
617641 -- clangd = {},
618- -- gopls = {},
619- -- pyright = {},
620- -- rust_analyzer = {},
642+ gopls = {
643+ settings = {
644+ gopls = {
645+ gofumpt = true ,
646+ codelenses = {
647+ gc_details = false ,
648+ generate = true ,
649+ regenerate_cgo = true ,
650+ run_govulncheck = true ,
651+ test = true ,
652+ tidy = true ,
653+ upgrade_dependency = true ,
654+ vendor = true ,
655+ },
656+ hints = {
657+ assignVariableTypes = true ,
658+ compositeLiteralFields = true ,
659+ compositeLiteralTypes = true ,
660+ constantValues = true ,
661+ functionTypeParameters = true ,
662+ parameterNames = true ,
663+ rangeVariableTypes = true ,
664+ },
665+ analyses = {
666+ fieldalignment = true ,
667+ nilness = true ,
668+ unusedparams = true ,
669+ unusedwrite = true ,
670+ useany = true ,
671+ },
672+ usePlaceholders = true ,
673+ completeUnimported = true ,
674+ staticcheck = true ,
675+ directoryFilters = { ' -.git' , ' -.vscode' , ' -.idea' , ' -.vscode-test' , ' -node_modules' },
676+ semanticTokens = true ,
677+ },
678+ },
679+ },
680+ pyright = {},
681+ rust_analyzer = {},
682+ docker_compose_language_service = {},
683+ dockerls = {},
621684 -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
622685 --
623686 -- Some languages (like typescript) have entire language plugins that can be useful:
624687 -- https://github.com/pmizio/typescript-tools.nvim
625688 --
626689 -- But for many setups, the LSP (`tsserver`) will work just fine
627- -- tsserver = {},
690+ tsserver = {
691+ javascript = {
692+ inlayHints = {
693+ includeInlayEnumMemberValueHints = true ,
694+ includeInlayFunctionLikeReturnTypeHints = true ,
695+ includeInlayFunctionParameterTypeHints = true ,
696+ includeInlayParameterNameHints = ' all' ,
697+ includeInlayParameterNameHintsWhenArgumentMatchesName = true ,
698+ includeInlayPropertyDeclarationTypeHints = true ,
699+ includeInlayVariableTypeHints = true ,
700+ },
701+ },
702+ typescript = {
703+ inlayHints = {
704+ includeInlayEnumMemberValueHints = true ,
705+ includeInlayFunctionLikeReturnTypeHints = true ,
706+ includeInlayFunctionParameterTypeHints = true ,
707+ includeInlayParameterNameHints = ' all' ,
708+ includeInlayParameterNameHintsWhenArgumentMatchesName = true ,
709+ includeInlayPropertyDeclarationTypeHints = true ,
710+ includeInlayVariableTypeHints = true ,
711+ },
712+ },
713+ },
628714 --
629715
630716 lua_ls = {
@@ -637,10 +723,14 @@ require('lazy').setup({
637723 callSnippet = ' Replace' ,
638724 },
639725 -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
640- -- diagnostics = { disable = { 'missing-fields' } },
726+ diagnostics = { -- disable = { 'missing-fields' } },
727+ globals = { ' vim' },
728+ },
729+ hint = { enable = true },
641730 },
642731 },
643732 },
733+ ols = {},
644734 }
645735
646736 -- Ensure the servers and tools above are installed
@@ -672,6 +762,7 @@ require('lazy').setup({
672762 },
673763 }
674764 end ,
765+ checker = { enabled = true },
675766 },
676767
677768 { -- Autoformat
@@ -712,7 +803,11 @@ require('lazy').setup({
712803 -- python = { "isort", "black" },
713804 --
714805 -- You can use 'stop_after_first' to run the first available formatter from the list
715- -- javascript = { "prettierd", "prettier", stop_after_first = true },
806+ -- You can use a sub-list to tell conform to run *until* a formatter
807+ -- is found.
808+ javascript = { { ' prettierd' , ' prettier' , stop_after_first = true } },
809+ typescript = { { ' prettierd' , ' prettier' , stop_after_first = true } },
810+ astro = { { ' prettierd' , ' prettier' , stop_after_first = true } },
716811 },
717812 },
718813 },
@@ -721,6 +816,7 @@ require('lazy').setup({
721816 ' hrsh7th/nvim-cmp' ,
722817 event = ' InsertEnter' ,
723818 dependencies = {
819+ ' nvim-neotest/nvim-nio' ,
724820 -- Snippet Engine & its associated nvim-cmp source
725821 {
726822 ' L3MON4D3/LuaSnip' ,
@@ -795,7 +891,7 @@ require('lazy').setup({
795891 -- Manually trigger a completion from nvim-cmp.
796892 -- Generally you don't need this, because nvim-cmp will display
797893 -- completions whenever it has completion options available.
798- [' <C-Space >' ] = cmp .mapping .complete {},
894+ [' <C-e >' ] = cmp .mapping .complete {},
799895
800896 -- Think of <c-l> as moving to the right of your snippet expansion.
801897 -- So if you have a snippet that's like:
@@ -894,6 +990,9 @@ require('lazy').setup({
894990 { -- Highlight, edit, and navigate code
895991 ' nvim-treesitter/nvim-treesitter' ,
896992 build = ' :TSUpdate' ,
993+ dependencies = {
994+ { ' nvim-treesitter/nvim-treesitter-context' , opts = { enable = true , mode = ' topline' , line_numbers = true } },
995+ },
897996 main = ' nvim-treesitter.configs' , -- Sets main module to use for opts
898997 -- [[ Configure Treesitter ]] See `:help nvim-treesitter`
899998 opts = {
@@ -926,7 +1025,7 @@ require('lazy').setup({
9261025 -- Here are some example plugins that I've included in the Kickstart repository.
9271026 -- Uncomment any of the lines below to enable them (you will need to restart nvim).
9281027 --
929- -- require 'kickstart.plugins.debug',
1028+ require ' kickstart.plugins.debug' ,
9301029 -- require 'kickstart.plugins.indent_line',
9311030 -- require 'kickstart.plugins.lint',
9321031 -- require 'kickstart.plugins.autopairs',
@@ -938,7 +1037,7 @@ require('lazy').setup({
9381037 --
9391038 -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
9401039 -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
941- -- { import = 'custom.plugins' },
1040+ { import = ' custom.plugins' },
9421041}, {
9431042 ui = {
9441043 -- If you are using a Nerd Font: set icons to an empty table which will use the
0 commit comments