Reformatted code after changing indent width to 2, TODO highlighting

- set all indent widths from 4 to 2
- added plugin to highlight TODO markers, can also be searched
  <leader>ft
This commit is contained in:
2024-09-19 21:48:06 +02:00
parent 73cb9eeca1
commit 1e98df6cc3
4 changed files with 309 additions and 289 deletions

View File

@@ -6,16 +6,17 @@ vim.keymap.set('n', '<leader>fg', fzf.live_grep, { desc = "Grep" })
vim.keymap.set('n', '<leader>fG', fzf.grep_cword, { desc = "Grep word under cursor" }) vim.keymap.set('n', '<leader>fG', fzf.grep_cword, { desc = "Grep word under cursor" })
vim.keymap.set('n', '<leader>fc', fzf.commands, { desc = "Commands" }) vim.keymap.set('n', '<leader>fc', fzf.commands, { desc = "Commands" })
vim.keymap.set('n', '<leader>fm', fzf.manpages, { desc = "Manpages" }) vim.keymap.set('n', '<leader>fm', fzf.manpages, { desc = "Manpages" })
vim.keymap.set('n', '<leader>b', fzf.buffers, { desc = "Buffers" }) vim.keymap.set('n', '<leader>b', fzf.buffers, { desc = "Buffers" })
vim.keymap.set('n', '<leader>ft', ":TodoFzfLua<CR>", { desc = "Todos" })
-- use fzf buffer lines as default search -- use fzf buffer lines as default search
vim.keymap.set('n', '/', fzf.blines, { desc = "Search buffer" }) vim.keymap.set('n', '/', fzf.blines, { desc = "Search buffer" })
vim.keymap.set('n', 'z=', fzf.spell_suggest, { desc = "Spelling suggestions" }) vim.keymap.set('n', 'z=', fzf.spell_suggest, { desc = "Spelling suggestions" })
-- open file manager and git -- open file manager and git
vim.keymap.set('n', '<leader>g', ":Neogit<CR>", { desc = "Git Manager" }) vim.keymap.set('n', '<leader>g', ":Neogit<CR>", { desc = "Neogit" })
vim.keymap.set('n', '<leader>T', ":Neotree<CR>", { desc = "File Manager" }) vim.keymap.set('n', '<leader>T', ":Neotree reveal<CR>", { desc = "File Manager" })
-- --
-- configure workspaces -- configure workspaces

View File

@@ -15,9 +15,10 @@ require('mason-lspconfig').setup({
'lua_ls', 'lua_ls',
'rust_analyzer', 'rust_analyzer',
'yamlls', 'yamlls',
'tsserver', 'ts_ls',
'gopls', 'gopls',
'pylsp', 'pylsp',
'clangd',
-- 'volar', -- 'volar',
}, },
}) })
@@ -80,7 +81,7 @@ require('mason-lspconfig').setup_handlers({
-- and will be called for each installed server that doesn't have -- and will be called for each installed server that doesn't have
-- a dedicated handler. -- a dedicated handler.
function(server_name) -- default handler (optional) function(server_name) -- default handler (optional)
if server_name == 'tsserver' then if server_name == 'ts_ls' then
-- taken from https://github.com/vuejs/language-tools -- taken from https://github.com/vuejs/language-tools
-- If you are using mason.nvim, you can get the ts_plugin_path like this -- If you are using mason.nvim, you can get the ts_plugin_path like this
local mason_registry = require('mason-registry') local mason_registry = require('mason-registry')

View File

@@ -4,9 +4,9 @@ vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
vim.opt.mouse = 'a' -- allow the mouse to be used in Nvim vim.opt.mouse = 'a' -- allow the mouse to be used in Nvim
-- Tab -- Tab
vim.opt.tabstop = 4 -- number of visual spaces per TAB vim.opt.tabstop = 2 -- number of visual spaces per TAB
vim.opt.softtabstop = 4 -- number of spacesin tab when editing vim.opt.softtabstop = 2 -- number of spacesin tab when editing
vim.opt.shiftwidth = 4 -- insert 4 spaces on a tab vim.opt.shiftwidth = 2 -- insert 4 spaces on a tab
vim.opt.expandtab = true -- tabs are spaces, mainly because of python vim.opt.expandtab = true -- tabs are spaces, mainly because of python
-- UI config -- UI config

View File

@@ -104,6 +104,12 @@ require("lazy").setup({
scroll_down = "<c-d>", -- binding to scroll down inside the popup scroll_down = "<c-d>", -- binding to scroll down inside the popup
scroll_up = "<c-u>", -- binding to scroll up inside the popup scroll_up = "<c-u>", -- binding to scroll up inside the popup
}, },
plugins = {
presets = {
motions = true,
g = true,
}
},
}, },
keys = { keys = {
{ {
@@ -114,6 +120,7 @@ require("lazy").setup({
desc = "Buffer Local Keymaps (which-key)", desc = "Buffer Local Keymaps (which-key)",
}, },
}, },
dependencies = { "echasnovski/mini.icons" },
}, },
-- treesitter -- treesitter
@@ -225,4 +232,15 @@ require("lazy").setup({
-- comfortable table editing -- comfortable table editing
{ 'dhruvasagar/vim-table-mode' }, { 'dhruvasagar/vim-table-mode' },
-- TODO, WARN, HACK, PERF, NOTE, TEST and others highlighting and searching
{
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
},
}) })