@@ -380,6 +380,7 @@ require('lazy').setup({
380380 vim .keymap .set (' n' , ' <leader>wl' , ' <C-w>l' , { desc = ' [W]indow Right' })
381381 vim .keymap .set (' n' , ' <leader>wq' , ' <C-w>q' , { desc = ' [W]indow Quit' })
382382 vim .keymap .set (' n' , ' <leader>w=' , ' <C-w>=' , { desc = ' [W]indow Equalize' })
383+ vim .keymap .set (' n' , ' <leader>e' , ' :Neotree toggle<CR>' , { desc = ' Toggle Neotree' })
383384
384385 -- Slightly advanced example of overriding default behavior and theme
385386 vim .keymap .set (' n' , ' <leader>/' , function ()
@@ -423,57 +424,18 @@ require('lazy').setup({
423424 -- Main LSP Configuration
424425 ' neovim/nvim-lspconfig' ,
425426 dependencies = {
426- -- Automatically install LSPs and related tools to stdpath for Neovim
427- -- Mason must be loaded before its dependents so we need to set it up here.
428- -- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
429427 { ' mason-org/mason.nvim' , opts = {} },
430428 ' mason-org/mason-lspconfig.nvim' ,
431429 ' WhoIsSethDaniel/mason-tool-installer.nvim' ,
432430
433- -- Useful status updates for LSP.
434431 { ' j-hui/fidget.nvim' , opts = {} },
435432
436- -- Allows extra capabilities provided by blink.cmp
437433 ' saghen/blink.cmp' ,
438434 },
439435 config = function ()
440- -- Brief aside: **What is LSP?**
441- --
442- -- LSP is an initialism you've probably heard, but might not understand what it is.
443- --
444- -- LSP stands for Language Server Protocol. It's a protocol that helps editors
445- -- and language tooling communicate in a standardized fashion.
446- --
447- -- In general, you have a "server" which is some tool built to understand a particular
448- -- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers
449- -- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone
450- -- processes that communicate with some "client" - in this case, Neovim!
451- --
452- -- LSP provides Neovim with features like:
453- -- - Go to definition
454- -- - Find references
455- -- - Autocompletion
456- -- - Symbol Search
457- -- - and more!
458- --
459- -- Thus, Language Servers are external tools that must be installed separately from
460- -- Neovim. This is where `mason` and related plugins come into play.
461- --
462- -- If you're wondering about lsp vs treesitter, you can check out the wonderfully
463- -- and elegantly composed help section, `:help lsp-vs-treesitter`
464-
465- -- This function gets run when an LSP attaches to a particular buffer.
466- -- That is to say, every time a new file is opened that is associated with
467- -- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this
468- -- function will be executed to configure the current buffer
469436 vim .api .nvim_create_autocmd (' LspAttach' , {
470437 group = vim .api .nvim_create_augroup (' kickstart-lsp-attach' , { clear = true }),
471438 callback = function (event )
472- -- NOTE: Remember that Lua is a real programming language, and as such it is possible
473- -- to define small helper and utility functions so you don't have to repeat yourself.
474- --
475- -- In this case, we create a function that lets us more easily define mappings specific
476- -- for LSP related items. It sets the mode, buffer and description for us each time.
477439 local map = function (keys , func , desc , mode )
478440 mode = mode or ' n'
479441 vim .keymap .set (mode , keys , func , { buffer = event .buf , desc = ' LSP: ' .. desc })
@@ -543,12 +505,24 @@ require('lazy').setup({
543505 callback = vim .lsp .buf .document_highlight ,
544506 })
545507
508+ vim .api .nvim_create_autocmd (' BufWritePre' , {
509+ pattern = ' *.go' ,
510+ callback = function ()
511+ vim .cmd ' silent! !gofmt -w %'
512+ end ,
513+ })
546514 vim .api .nvim_create_autocmd ({ ' CursorMoved' , ' CursorMovedI' }, {
547515 buffer = event .buf ,
548516 group = highlight_augroup ,
549517 callback = vim .lsp .buf .clear_references ,
550518 })
551519
520+ vim .api .nvim_create_autocmd (' CursorHold' , {
521+ callback = function ()
522+ vim .diagnostic .open_float (nil , { focusable = false })
523+ end ,
524+ })
525+
552526 vim .api .nvim_create_autocmd (' LspDetach' , {
553527 group = vim .api .nvim_create_augroup (' kickstart-lsp-detach' , { clear = true }),
554528 callback = function (event2 )
@@ -616,18 +590,6 @@ require('lazy').setup({
616590 -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
617591 local servers = {
618592 -- clangd = {},
619- -- gopls = {},
620- -- pyright = {},
621- -- rust_analyzer = {},
622- -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
623- --
624- -- Some languages (like typescript) have entire language plugins that can be useful:
625- -- https://github.com/pmizio/typescript-tools.nvim
626- --
627- -- But for many setups, the LSP (`ts_ls`) will work just fine
628- -- ts_ls = {},
629- --
630-
631593 lua_ls = {
632594 -- cmd = { ... },
633595 -- filetypes = { ... },
@@ -828,11 +790,11 @@ require('lazy').setup({
828790 -- change the command in the config to whatever the name of that colorscheme is.
829791 --
830792 -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
831- ' folke/tokyonight .nvim' ,
793+ ' thesimonho/kanagawa-paper .nvim' ,
832794 priority = 1000 , -- Make sure to load this before all the other start plugins.
833795 config = function ()
834796 --- @diagnostic disable-next-line : missing-fields
835- require (' tokyonight ' ).setup {
797+ require (' kanagawa-paper ' ).setup {
836798 styles = {
837799 comments = { italic = false }, -- Disable italics in comments
838800 },
@@ -841,7 +803,14 @@ require('lazy').setup({
841803 -- Load the colorscheme here.
842804 -- Like many other themes, this one has different styles, and you could load
843805 -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
844- vim .cmd .colorscheme ' tokyonight-night'
806+ vim .cmd .colorscheme ' kanagawa-paper'
807+
808+ vim .api .nvim_set_hl (0 , ' Normal' , { bg = ' none' })
809+ vim .api .nvim_set_hl (0 , ' NormalNC' , { bg = ' none' })
810+ vim .api .nvim_set_hl (0 , ' NormalFloat' , { bg = ' none' })
811+ vim .api .nvim_set_hl (0 , ' FloatBorder' , { bg = ' none' })
812+ vim .api .nvim_set_hl (0 , ' SignColumn' , { bg = ' none' })
813+ vim .api .nvim_set_hl (0 , ' VertSplit' , { bg = ' none' })
845814 end ,
846815 },
847816
0 commit comments