Skip to content

Commit 53fcf70

Browse files
committed
Add lazydocker and remote-nvim
1 parent c9cab9e commit 53fcf70

File tree

9 files changed

+163
-38
lines changed

9 files changed

+163
-38
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ In the file: `lua/custom/plugins/autopairs.lua`, add:
115115
-- File: lua/custom/plugins/autopairs.lua
116116

117117
return {
118-
"windwp/nvim-autopairs",
118+
-- "windwp/nvim-autopairs",
119119
-- Optional dependency
120120
dependencies = { 'hrsh7th/nvim-cmp' },
121121
config = function()

cheatsheet.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Treesitter
2+
===
3+
4+
Incremental Selection:
5+
Next node <C-Space>
6+
Previous node <bs>

init.lua

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,8 @@ require('lazy').setup {
319319
{ '<leader>s_', hidden = true },
320320
{ '<leader>w', group = '[W]orkspace'},
321321
{ '<leader>w_', hidden = true },
322+
{ '<leader>g', group = '[G]oto'},
323+
{ '<leader>g_', hidden = true },
322324
}
323325
end,
324326
},
@@ -388,6 +390,47 @@ require('lazy').setup {
388390
-- },
389391
-- },
390392
-- pickers = {}
393+
defaults = {
394+
-- configure to use ripgrep
395+
vimgrep_arguments = {
396+
"rg",
397+
"--follow", -- Follow symbolic links
398+
"--hidden", -- Search for hidden files
399+
"--no-heading", -- Don't group matches by each file
400+
"--with-filename", -- Print the file path with the matched lines
401+
"--line-number", -- Show line numbers
402+
"--column", -- Show column numbers
403+
"--smart-case", -- Smart case search
404+
405+
-- Exclude some patterns from search
406+
"--glob=!**/.git/*",
407+
"--glob=!**/.idea/*",
408+
"--glob=!**/.vscode/*",
409+
"--glob=!**/build/*",
410+
"--glob=!**/dist/*",
411+
"--glob=!**/yarn.lock",
412+
"--glob=!**/package-lock.json",
413+
},
414+
},
415+
pickers = {
416+
find_files = {
417+
hidden = true,
418+
-- needed to exclude some files & dirs from general search
419+
-- when not included or specified in .gitignore
420+
find_command = {
421+
"rg",
422+
"--files",
423+
"--hidden",
424+
"--glob=!**/.git/*",
425+
"--glob=!**/.idea/*",
426+
"--glob=!**/.vscode/*",
427+
"--glob=!**/build/*",
428+
"--glob=!**/dist/*",
429+
"--glob=!**/yarn.lock",
430+
"--glob=!**/package-lock.json",
431+
},
432+
},
433+
},
391434
extensions = {
392435
['ui-select'] = {
393436
require('telescope.themes').get_dropdown(),

lua/custom/plugins/lazydocker.lua

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
-- lazydocker.nvim
2+
-- You must first install Lazydocker on your system, see https://github.com/jesseduffield/lazydocker for instructions
3+
return {
4+
"mgierada/lazydocker.nvim",
5+
dependencies = { "akinsho/toggleterm.nvim" },
6+
config = function()
7+
require("lazydocker").setup({})
8+
end,
9+
event = "BufRead",
10+
keys = {
11+
{
12+
"<leader>ld",
13+
function()
14+
require("lazydocker").open()
15+
end,
16+
desc = "Open Lazydocker floating window",
17+
},
18+
},
19+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
return {
2+
'Shatur/neovim-tasks',
3+
dependencies = {
4+
'nvim-lua/plenary.nvim',
5+
'mfussenegger/nvim-dap' -- optional only for debugger
6+
},
7+
config = function()
8+
local Path = require('plenary.path')
9+
require('tasks').setup({
10+
default_params = { -- Default module parameters with which `neovim.json` will be created.
11+
cmake = {
12+
cmd = 'cmake', -- CMake executable to use, can be changed using `:Task set_module_param cmake cmd`.
13+
-- build_dir = tostring(Path:new('{cwd}', 'build', '{os}-{build_type}')), -- Build directory. The expressions `{cwd}`, `{os}` and `{build_type}` will be expanded with the corresponding text values. Could be a function that return the path to the build directory.
14+
build_dir = tostring(Path:new('{cwd}', 'build')), -- Build directory. The expressions `{cwd}`, `{os}` and `{build_type}` will be expanded with the corresponding text values. Could be a function that return the path to the build directory.
15+
build_type = 'RelWithDebInfo', -- Build type, can be changed using `:Task set_module_param cmake build_type`.
16+
dap_name = 'lldb', -- DAP configuration name from `require('dap').configurations`. If there is no such configuration, a new one with this name as `type` will be created.
17+
args = { -- Task default arguments.
18+
configure = { '-D', 'CMAKE_EXPORT_COMPILE_COMMANDS=1', '-G', 'Ninja' },
19+
},
20+
},
21+
},
22+
save_before_run = true, -- If true, all files will be saved before executing a task.
23+
params_file = 'neovim.json', -- JSON file to store module and task parameters.
24+
quickfix = {
25+
pos = 'botright', -- Default quickfix position.
26+
height = 12, -- Default height.
27+
},
28+
})
29+
end
30+
}

lua/custom/plugins/nvim-lspconfig.lua

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ return { -- LSP Configuration & Plugins
55
'williamboman/mason.nvim',
66
'williamboman/mason-lspconfig.nvim',
77
'WhoIsSethDaniel/mason-tool-installer.nvim',
8+
'Shatur/neovim-tasks', -- XXX: only required for clangd, how to express this
89

910
-- Useful status updates for LSP.
1011
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
@@ -50,25 +51,25 @@ return { -- LSP Configuration & Plugins
5051
-- In this case, we create a function that lets us more easily define mappings specific
5152
-- for LSP related items. It sets the mode, buffer and description for us each time.
5253
local map = function(keys, func, desc)
53-
vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
54+
vim.keymap.set('n', keys, func, { buffer = event.buf, desc = desc })
5455
end
5556

5657
-- Jump to the definition of the word under your cursor.
5758
-- This is where a variable was first declared, or where a function is defined, etc.
5859
-- To jump back, press <C-T>.
59-
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
60+
map('<leader>gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
6061

6162
-- Find references for the word under your cursor.
62-
map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
63+
map('<leader>gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
6364

6465
-- Jump to the implementation of the word under your cursor.
6566
-- Useful when your language has ways of declaring types without an actual implementation.
66-
map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
67+
map('<leader>gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
6768

6869
-- Jump to the type of the word under your cursor.
6970
-- Useful when you're not sure what type a variable is and you want to see
7071
-- the definition of its *type*, not where it was *defined*.
71-
map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
72+
map('<leader>gD', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
7273

7374
-- Fuzzy find all the symbols in your current document.
7475
-- Symbols are things like variables, functions, types, etc.
@@ -88,6 +89,7 @@ return { -- LSP Configuration & Plugins
8889

8990
-- Opens a popup that displays documentation about the word under your cursor
9091
-- See `:help K` for why this keymap
92+
map('<leader>cK', vim.lsp.buf.hover, 'Hover Documentation')
9193
map('K', vim.lsp.buf.hover, 'Hover Documentation')
9294

9395
-- WARN: This is not Goto Definition, this is Goto Declaration.
@@ -98,6 +100,7 @@ return { -- LSP Configuration & Plugins
98100
local client = vim.lsp.get_client_by_id(event.data.client_id)
99101
if client.name == 'clangd' then
100102
map('gh', ':ClangdSwitchSourceHeader<CR>', '[G]o to [H]eader or Source (clang)')
103+
map('<leader>cb', ':Task start cmake build<CR>', '[C]ode [B]uild (cmake)')
101104
end
102105

103106
-- The following two autocommands are used to highlight references of the
@@ -149,7 +152,6 @@ return { -- LSP Configuration & Plugins
149152
-- But for many setups, the LSP (`tsserver`) will work just fine
150153
tsserver = {},
151154
--
152-
153155
lua_ls = {
154156
-- cmd = {...},
155157
-- filetypes { ...},
@@ -193,6 +195,7 @@ return { -- LSP Configuration & Plugins
193195
'stylua', -- Used to format lua code
194196
'tailwindcss-language-server',
195197
'typescript-language-server',
198+
'yaml-language-server',
196199
})
197200
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
198201

lua/custom/plugins/nvim-treesitter.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ return { -- Highlight, edit, and navigate code
1414
ensure_installed = { 'lua', 'bash', 'c', 'cpp', 'html', 'lua', 'markdown', 'markdown_inline', 'vim', 'vimdoc', 'typescript', 'javascript', 'tsx', 'yaml', 'json' },
1515
-- Autoinstall languages that are not installed
1616
auto_install = true,
17-
highlight = { enable = true },
17+
highlight =
18+
{
19+
enable = true,
20+
additional_vim_regex_highlighting = true,
21+
},
1822
indent =
1923
{
2024
enable = true,
Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
return { -- Auto-close tags for HTML and JSX
2-
"windwp/nvim-ts-autotag",
3-
dependencies = { "nvim-treesitter/nvim-treesitter" },
4-
config = function()
5-
require("nvim-ts-autotag").setup({
6-
opts = {
7-
-- Defaults
8-
enable = true,
9-
filetypes = {
10-
"html",
11-
"javascriptreact",
12-
"javascript",
13-
"typescript",
14-
"typescriptreact",
15-
"tsx",
16-
"jsx",
17-
},
18-
enable_close = true, -- Auto close tags
19-
enable_rename = true, -- Auto rename pairs of tags
20-
enable_close_on_slash = false -- Auto close on trailing </
21-
-- Also override individual filetype configs, these take priority.
22-
-- Empty by default, useful if one of the "opts" global settings
23-
-- doesn't work well in a specific filetype
24-
-- per_filetype = {
25-
-- ["html"] = {
26-
-- enable_close = false
27-
-- }
28-
-- }
29-
}
30-
})
31-
end
2+
-- "windwp/nvim-ts-autotag",
3+
-- dependencies = { "nvim-treesitter/nvim-treesitter" },
4+
-- config = function()
5+
-- require("nvim-ts-autotag").setup({
6+
-- opts = {
7+
-- -- Defaults
8+
-- enable = true,
9+
-- filetypes = {
10+
-- "html",
11+
-- "javascriptreact",
12+
-- "javascript",
13+
-- "typescript",
14+
-- "typescriptreact",
15+
-- "tsx",
16+
-- "jsx",
17+
-- },
18+
-- enable_close = true, -- Auto close tags
19+
-- enable_rename = true, -- Auto rename pairs of tags
20+
-- enable_close_on_slash = false -- Auto close on trailing </
21+
-- -- Also override individual filetype configs, these take priority.
22+
-- -- Empty by default, useful if one of the "opts" global settings
23+
-- -- doesn't work well in a specific filetype
24+
-- -- per_filetype = {
25+
-- -- ["html"] = {
26+
-- -- enable_close = false
27+
-- -- }
28+
-- -- }
29+
-- }
30+
-- })
31+
-- end
3232
}

lua/custom/plugins/remote-nvim.lua

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
return {
2+
"amitds1997/remote-nvim.nvim",
3+
version = "*", -- Pin to GitHub releases
4+
dependencies = {
5+
"nvim-lua/plenary.nvim", -- For standard functions
6+
"MunifTanjim/nui.nvim", -- To build the plugin UI
7+
"nvim-telescope/telescope.nvim", -- For picking b/w different remote methods
8+
},
9+
config = true
10+
-- config = function()
11+
-- require("remote-nvim").setup(
12+
-- {
13+
-- -- Configuration for devpod connections
14+
-- devpod = {
15+
-- binary = "devpod", -- Binary to use for devpod
16+
-- }
17+
-- }
18+
-- )
19+
-- end,
20+
}

0 commit comments

Comments
 (0)