···11return {
22- 'stunwin/lilguys.nvim',
22+ 'https://tangled.org/@stunwin.com/lilguys.nvim',
33 opts = {
44 keybind = '<leader>.', -- toggles a lil guy in at the front of the line. Respects whitespace.
55 insert_keybind = '<leader>,', -- adds a lil guy and a space right before your curor
+81-69
.config/nvim/lua/plugins/lspconfig.lua
···2020 --
2121 -- In this case, we create a function that lets us more easily define mappings specific
2222 -- for LSP related items. It sets the mode, buffer and description for us each time.
2323- local map = function(keys, func, desc)
2424- vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
2323+ local map = function(keys, func, desc, mode)
2424+ mode = mode or 'n'
2525+ vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
2526 end
26272727- -- Jump to the definition of the word under your cursor.
2828- -- This is where a variable was first declared, or where a function is defined, etc.
2929- -- To jump back, press <C-t>.
3030- map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
2828+ -- Rename the variable under your cursor.
2929+ -- Most Language Servers support renaming across files, etc.
3030+ map('grn', vim.lsp.buf.rename, '[R]e[n]ame')
3131+3232+ -- Execute a code action, usually your cursor needs to be on top of an error
3333+ -- or a suggestion from your LSP for this to activate.
3434+ map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' })
31353236 -- Find references for the word under your cursor.
3333- map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
3737+ map('grr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
34383539 -- Jump to the implementation of the word under your cursor.
3640 -- Useful when your language has ways of declaring types without an actual implementation.
3737- map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
4141+ map('gri', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
38423939- -- Jump to the type of the word under your cursor.
4040- -- Useful when you're not sure what type a variable is and you want to see
4141- -- the definition of its *type*, not where it was *defined*.
4242- map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
4343+ -- Jump to the definition of the word under your cursor.
4444+ -- This is where a variable was first declared, or where a function is defined, etc.
4545+ -- To jump back, press <C-t>.
4646+ map('grd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
4747+4848+ -- WARN: This is not Goto Definition, this is Goto Declaration.
4949+ -- For example, in C this would take you to the header.
5050+ map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
43514452 -- Fuzzy find all the symbols in your current document.
4553 -- Symbols are things like variables, functions, types, etc.
4646- map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
5454+ map('gO', require('telescope.builtin').lsp_document_symbols, 'Open Document Symbols')
47554856 -- Fuzzy find all the symbols in your current workspace.
4957 -- Similar to document symbols, except searches over your entire project.
5050- map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
5858+ map('gW', require('telescope.builtin').lsp_dynamic_workspace_symbols, 'Open Workspace Symbols')
51595252- -- Rename the variable under your cursor.
5353- -- Most Language Servers support renaming across files, etc.
5454- map('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
6060+ -- Jump to the type of the word under your cursor.
6161+ -- Useful when you're not sure what type a variable is and you want to see
6262+ -- the definition of its *type*, not where it was *defined*.
6363+ map('grt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition')
55645656- -- Execute a code action, usually your cursor needs to be on top of an error
5757- -- or a suggestion from your LSP for this to activate.
5858- map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
5959-6060- -- Opens a popup that displays documentation about the word under your cursor
6161- -- See `:help K` for why this keymap.
6262- map('K', vim.lsp.buf.hover, 'Hover Documentation')
6363-6464- -- WARN: This is not Goto Definition, this is Goto Declaration.
6565- -- For example, in C this would take you to the header.
6666- map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
6565+ -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
6666+ ---@param client vim.lsp.Client
6767+ ---@param method vim.lsp.protocol.Method
6868+ ---@param bufnr? integer some lsp support methods only in specific files
6969+ ---@return boolean
7070+ local function client_supports_method(client, method, bufnr)
7171+ if vim.fn.has 'nvim-0.11' == 1 then
7272+ return client:supports_method(method, bufnr)
7373+ else
7474+ return client.supports_method(method, { bufnr = bufnr })
7575+ end
7676+ end
67776878 -- The following two autocommands are used to highlight references of the
6979 -- word under your cursor when your cursor rests there for a little while.
···7181 --
7282 -- When you move your cursor, the highlights will be cleared (the second autocommand).
7383 local client = vim.lsp.get_client_by_id(event.data.client_id)
7474- if client and client.server_capabilities.documentHighlightProvider then
8484+ if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then
7585 local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
7686 vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
7787 buffer = event.buf,
···8494 group = highlight_augroup,
8595 callback = vim.lsp.buf.clear_references,
8696 })
9797+9898+ vim.api.nvim_create_autocmd('LspDetach', {
9999+ group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }),
100100+ callback = function(event2)
101101+ vim.lsp.buf.clear_references()
102102+ vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf }
103103+ end,
104104+ })
87105 end
881068989- -- The following autocommand is used to enable inlay hints in your
107107+ -- The following code creates a keymap to toggle inlay hints in your
90108 -- code, if the language server you are using supports them
91109 --
92110 -- This may be unwanted, since they displace some of your code
9393- if client and client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then
111111+ if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
94112 map('<leader>th', function()
9595- vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
113113+ vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
96114 end, '[T]oggle Inlay [H]ints')
97115 end
98116 end,
99117 })
100118101101- vim.api.nvim_create_autocmd('LspDetach', {
102102- group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }),
103103- callback = function(event)
104104- vim.lsp.buf.clear_references()
105105- vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event.buf }
106106- end,
107107- })
108108-109119 local capabilities = vim.lsp.protocol.make_client_capabilities()
110120 -- add autocomplete capes for cmp or blink
111121 capabilities = vim.tbl_deep_extend('force', capabilities, require('blink.cmp').get_lsp_capabilities())
112122113113- -- godot
114114- require('lspconfig').gdscript.setup(capabilities)
115115-116116- -- manually adding gleam LSP because it's not in mason
117117- require('lspconfig').gleam.setup {}
123123+ -- trying some new stuff for 0.11
124124+ -- old config is:
125125+ -- require('lspconfig').gleam.setup {}
126126+ -- new config:
127127+ -- these are lsp servers that, for one reason or another, don't work with mason
128128+ local manual_servers = { 'gleam', 'gdscript', 'zig' }
129129+ for _, server in ipairs(manual_servers) do
130130+ vim.lsp.config(server, { capabilities = capabilities })
131131+ vim.lsp.enable(server)
132132+ end
118133119119- local servers =
120120- {
121121- -- gleam = { mason = false },
122122- pyright = {
123123- settings = {
124124- python = {
125125- diagnostics = {
126126- disable = { 'reportArgumentType', 'reportAssignmentType' },
127127- },
134134+ local servers = {
135135+ -- gleam = { mason = false },
136136+ pyright = {
137137+ settings = {
138138+ python = {
139139+ diagnostics = {
140140+ disable = { 'reportArgumentType', 'reportAssignmentType' },
128141 },
129142 },
130143 },
144144+ },
131145132132- lua_ls = {
133133- settings = {
134134- Lua = {
135135- completion = {
136136- callSnippet = 'Replace',
137137- },
138138- diagnostics = {
139139- disable = { 'lowercase-global' },
140140- },
141141- -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
142142- -- diagnostics = { disable = { 'missing-fields' } },
146146+ lua_ls = {
147147+ settings = {
148148+ Lua = {
149149+ completion = {
150150+ callSnippet = 'Replace',
151151+ },
152152+ diagnostics = {
153153+ disable = { 'lowercase-global' },
143154 },
155155+ -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
156156+ -- diagnostics = { disable = { 'missing-fields' } },
144157 },
145158 },
146146- }, require('mason').setup()
159159+ },
160160+ }
147161148162 -- You can add other tools here that you want Mason to install
149163 -- for you, so that they are available from within Neovim.
150164 local ensure_installed = vim.tbl_keys(servers or {})
151151- vim.list_extend(ensure_installed, {
152152- 'stylua', -- Used to format Lua code
153153- })
165165+ vim.list_extend(ensure_installed, {})
154166 require('mason-tool-installer').setup { ensure_installed = ensure_installed }
155167156168 require('mason-lspconfig').setup {
···2222-- Keep signcolumn on by default
2323vim.opt.signcolumn = 'yes'
24242525--- Decrease update time
2525+-- Swap file refresh time
2626vim.opt.updatetime = 250
27272828-- Decrease mapped sequence wait time
+1-1
.config/waybar/config.jsonc
···9191 },
92929393 "custom/paru": {
9494- "format": "{} ",
9494+ "format": "{} ",
9595 "tooltip-format": "There are {} packages with available updates. Click to make it happen.",
9696 "interval": 3600,
9797 "exec": "paru -Qu | wc -l",
+1-1
.config/waybar/custom/player.sh
···6677# If no player found
88if [ -z "$player" ]; then
99- echo "{\"text\": \" No media\", \"tooltip\": \"Nothing playing\"}"
99+ echo "{\"text\": \" No media\", \"tooltip\": \"Nothing playing\"}"
1010 exit
1111fi
1212