Skip to content

Commit 5100daf

Browse files
Merge pull request #3 from andreiblt1304/merge-main
Merge main
2 parents a6df9ca + 690598c commit 5100daf

File tree

3 files changed

+269
-46
lines changed

3 files changed

+269
-46
lines changed

init.lua

Lines changed: 215 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -172,16 +172,213 @@ vim.opt.rtp:prepend(lazypath)
172172

173173
-- [[ Configure plugins ]]
174174
-- NOTE: Here is where you install your plugins.
175-
-- You can configure plugins using the `config` key.
176-
--
177-
-- You can also configure plugins after the setup call,
178-
-- as they will be available in your neovim runtime.
179175
require('lazy').setup {
180-
-- NOTE: First, some plugins that don't require any configuration
181-
{
182-
'junegunn/fzf',
183-
build = function()
184-
vim.fn['fzf#install']()
176+
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
177+
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
178+
179+
-- NOTE: Plugins can also be added by using a table,
180+
-- with the first argument being the link and the following
181+
-- keys can be used to configure plugin behavior/loading/etc.
182+
--
183+
-- Use `opts = {}` to force a plugin to be loaded.
184+
--
185+
186+
-- Here is a more advanced example where we pass configuration
187+
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
188+
-- require('gitsigns').setup({ ... })
189+
--
190+
-- See `:help gitsigns` to understand what the configuration keys do
191+
{ -- Adds git related signs to the gutter, as well as utilities for managing changes
192+
'lewis6991/gitsigns.nvim',
193+
opts = {
194+
signs = {
195+
add = { text = '+' },
196+
change = { text = '~' },
197+
delete = { text = '_' },
198+
topdelete = { text = '' },
199+
changedelete = { text = '~' },
200+
},
201+
},
202+
},
203+
204+
-- NOTE: Plugins can also be configured to run Lua code when they are loaded.
205+
--
206+
-- This is often very useful to both group configuration, as well as handle
207+
-- lazy loading plugins that don't need to be loaded immediately at startup.
208+
--
209+
-- For example, in the following configuration, we use:
210+
-- event = 'VimEnter'
211+
--
212+
-- which loads which-key before all the UI elements are loaded. Events can be
213+
-- normal autocommands events (`:help autocmd-events`).
214+
--
215+
-- Then, because we use the `config` key, the configuration only runs
216+
-- after the plugin has been loaded:
217+
-- config = function() ... end
218+
219+
{ -- Useful plugin to show you pending keybinds.
220+
'folke/which-key.nvim',
221+
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
222+
opts = {
223+
icons = {
224+
-- set icon mappings to true if you have a Nerd Font
225+
mappings = vim.g.have_nerd_font,
226+
-- If you are using a Nerd Font: set icons.keys to an empty table which will use the
227+
-- default which-key.nvim defined Nerd Font icons, otherwise define a string table
228+
keys = vim.g.have_nerd_font and {} or {
229+
Up = '<Up> ',
230+
Down = '<Down> ',
231+
Left = '<Left> ',
232+
Right = '<Right> ',
233+
C = '<C-…> ',
234+
M = '<M-…> ',
235+
D = '<D-…> ',
236+
S = '<S-…> ',
237+
CR = '<CR> ',
238+
Esc = '<Esc> ',
239+
ScrollWheelDown = '<ScrollWheelDown> ',
240+
ScrollWheelUp = '<ScrollWheelUp> ',
241+
NL = '<NL> ',
242+
BS = '<BS> ',
243+
Space = '<Space> ',
244+
Tab = '<Tab> ',
245+
F1 = '<F1>',
246+
F2 = '<F2>',
247+
F3 = '<F3>',
248+
F4 = '<F4>',
249+
F5 = '<F5>',
250+
F6 = '<F6>',
251+
F7 = '<F7>',
252+
F8 = '<F8>',
253+
F9 = '<F9>',
254+
F10 = '<F10>',
255+
F11 = '<F11>',
256+
F12 = '<F12>',
257+
},
258+
},
259+
260+
-- Document existing key chains
261+
spec = {
262+
{ '<leader>c', group = '[C]ode', mode = { 'n', 'x' } },
263+
{ '<leader>d', group = '[D]ocument' },
264+
{ '<leader>r', group = '[R]ename' },
265+
{ '<leader>s', group = '[S]earch' },
266+
{ '<leader>w', group = '[W]orkspace' },
267+
{ '<leader>t', group = '[T]oggle' },
268+
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
269+
},
270+
},
271+
},
272+
273+
-- NOTE: Plugins can specify dependencies.
274+
--
275+
-- The dependencies are proper plugin specifications as well - anything
276+
-- you do for a plugin at the top level, you can do for a dependency.
277+
--
278+
-- Use the `dependencies` key to specify the dependencies of a particular plugin
279+
280+
{ -- Fuzzy Finder (files, lsp, etc)
281+
'nvim-telescope/telescope.nvim',
282+
event = 'VimEnter',
283+
branch = '0.1.x',
284+
dependencies = {
285+
'nvim-lua/plenary.nvim',
286+
{ -- If encountering errors, see telescope-fzf-native README for installation instructions
287+
'nvim-telescope/telescope-fzf-native.nvim',
288+
289+
-- `build` is used to run some command when the plugin is installed/updated.
290+
-- This is only run then, not every time Neovim starts up.
291+
build = 'make',
292+
293+
-- `cond` is a condition used to determine whether this plugin should be
294+
-- installed and loaded.
295+
cond = function()
296+
return vim.fn.executable 'make' == 1
297+
end,
298+
},
299+
{ 'nvim-telescope/telescope-ui-select.nvim' },
300+
301+
-- Useful for getting pretty icons, but requires a Nerd Font.
302+
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
303+
},
304+
config = function()
305+
-- Telescope is a fuzzy finder that comes with a lot of different things that
306+
-- it can fuzzy find! It's more than just a "file finder", it can search
307+
-- many different aspects of Neovim, your workspace, LSP, and more!
308+
--
309+
-- The easiest way to use Telescope, is to start by doing something like:
310+
-- :Telescope help_tags
311+
--
312+
-- After running this command, a window will open up and you're able to
313+
-- type in the prompt window. You'll see a list of `help_tags` options and
314+
-- a corresponding preview of the help.
315+
--
316+
-- Two important keymaps to use while in Telescope are:
317+
-- - Insert mode: <c-/>
318+
-- - Normal mode: ?
319+
--
320+
-- This opens a window that shows you all of the keymaps for the current
321+
-- Telescope picker. This is really useful to discover what Telescope can
322+
-- do as well as how to actually do it!
323+
324+
-- [[ Configure Telescope ]]
325+
-- See `:help telescope` and `:help telescope.setup()`
326+
require('telescope').setup {
327+
-- You can put your default mappings / updates / etc. in here
328+
-- All the info you're looking for is in `:help telescope.setup()`
329+
--
330+
-- defaults = {
331+
-- mappings = {
332+
-- i = { ['<c-enter>'] = 'to_fuzzy_refine' },
333+
-- },
334+
-- },
335+
-- pickers = {}
336+
extensions = {
337+
['ui-select'] = {
338+
require('telescope.themes').get_dropdown(),
339+
},
340+
},
341+
}
342+
343+
-- Enable Telescope extensions if they are installed
344+
pcall(require('telescope').load_extension, 'fzf')
345+
pcall(require('telescope').load_extension, 'ui-select')
346+
347+
-- See `:help telescope.builtin`
348+
local builtin = require 'telescope.builtin'
349+
vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
350+
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
351+
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
352+
vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
353+
vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' })
354+
vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' })
355+
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
356+
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
357+
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
358+
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
359+
360+
-- Slightly advanced example of overriding default behavior and theme
361+
vim.keymap.set('n', '<leader>/', function()
362+
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
363+
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
364+
winblend = 10,
365+
previewer = false,
366+
})
367+
end, { desc = '[/] Fuzzily search in current buffer' })
368+
369+
-- It's also possible to pass additional configuration options.
370+
-- See `:help telescope.builtin.live_grep()` for information about particular keys
371+
vim.keymap.set('n', '<leader>s/', function()
372+
builtin.live_grep {
373+
grep_open_files = true,
374+
prompt_title = 'Live Grep in Open Files',
375+
}
376+
end, { desc = '[S]earch [/] in Open Files' })
377+
378+
-- Shortcut for searching your Neovim configuration files
379+
vim.keymap.set('n', '<leader>sn', function()
380+
builtin.find_files { cwd = vim.fn.stdpath 'config' }
381+
end, { desc = '[S]earch [N]eovim files' })
185382
end,
186383
},
187384
{
@@ -326,20 +523,15 @@ require('lazy').setup {
326523
},
327524
},
328525

329-
-- NOTE: Plugins can also be configured to run Lua code when they are loaded.
330-
--
331-
-- This is often very useful to both group configuration, as well as handle
332-
-- lazy loading plugins that don't need to be loaded immediately at startup.
333-
--
334-
-- For example, in the following configuration, we use:
335-
-- event = 'VimEnter'
336-
--
337-
-- which loads which-key before all the UI elements are loaded. Events can be
338-
-- normal autocommands events (`:help autocmd-events`).
339-
--
340-
-- Then, because we use the `config` key, the configuration only runs
341-
-- after the plugin has been loaded:
342-
-- config = function() ... end
526+
-- Change diagnostic symbols in the sign column (gutter)
527+
-- if vim.g.have_nerd_font then
528+
-- local signs = { ERROR = '', WARN = '', INFO = '', HINT = '' }
529+
-- local diagnostic_signs = {}
530+
-- for type, icon in pairs(signs) do
531+
-- diagnostic_signs[vim.diagnostic.severity[type]] = icon
532+
-- end
533+
-- vim.diagnostic.config { signs = { text = diagnostic_signs } }
534+
-- end
343535

344536
{ -- Useful plugin to show you pending keybinds.
345537
'folke/which-key.nvim',

lazy-lock.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"conform.nvim": { "branch": "master", "commit": "a203480a350b03092e473bf3001733d547160a73" },
88
"fidget.nvim": { "branch": "main", "commit": "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f" },
99
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
10-
"fzf": { "branch": "master", "commit": "7d9548919e9b1bb05bb95225275e34213a747cde" },
1110
"fzfx.nvim": { "branch": "main", "commit": "599b02392fa1140f0ea6255b8c4bed5816df2dad" },
1211
"git-blame.nvim": { "branch": "master", "commit": "2883a7460f611c2705b23f12d58d398d5ce6ec00" },
1312
"gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },
@@ -42,6 +41,7 @@
4241
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
4342
"toggleterm.nvim": { "branch": "main", "commit": "87b2d6a3cab8e2bd9a0255427074285f0365398d" },
4443
"tokyonight.nvim": { "branch": "main", "commit": "c2725eb6d086c8c9624456d734bd365194660017" },
44+
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
4545
"which-key.nvim": { "branch": "main", "commit": "b9684c6ec54d8a8452bdcf0d613c7ad0223fc3fe" },
4646
"window-picker": { "branch": "main", "commit": "41cfaa428577c53552200a404ae9b3a0b5719706" }
4747
}

lua/kickstart/plugins/debug.lua

Lines changed: 53 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,59 @@ return {
2121
-- Add your own debuggers here
2222
'leoluz/nvim-dap-go',
2323
},
24-
keys = function(_, keys)
25-
local dap = require 'dap'
26-
local dapui = require 'dapui'
27-
return {
28-
-- Basic debugging keymaps, feel free to change to your liking!
29-
{ '<F5>', dap.continue, desc = 'Debug: Start/Continue' },
30-
{ '<F1>', dap.step_into, desc = 'Debug: Step Into' },
31-
{ '<F2>', dap.step_over, desc = 'Debug: Step Over' },
32-
{ '<F3>', dap.step_out, desc = 'Debug: Step Out' },
33-
{ '<leader>b', dap.toggle_breakpoint, desc = 'Debug: Toggle Breakpoint' },
34-
{
35-
'<leader>B',
36-
function()
37-
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
38-
end,
39-
desc = 'Debug: Set Breakpoint',
40-
},
41-
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
42-
{ '<F7>', dapui.toggle, desc = 'Debug: See last session result.' },
43-
unpack(keys),
44-
}
45-
end,
24+
keys = {
25+
-- Basic debugging keymaps, feel free to change to your liking!
26+
{
27+
'<F5>',
28+
function()
29+
require('dap').continue()
30+
end,
31+
desc = 'Debug: Start/Continue',
32+
},
33+
{
34+
'<F1>',
35+
function()
36+
require('dap').step_into()
37+
end,
38+
desc = 'Debug: Step Into',
39+
},
40+
{
41+
'<F2>',
42+
function()
43+
require('dap').step_over()
44+
end,
45+
desc = 'Debug: Step Over',
46+
},
47+
{
48+
'<F3>',
49+
function()
50+
require('dap').step_out()
51+
end,
52+
desc = 'Debug: Step Out',
53+
},
54+
{
55+
'<leader>b',
56+
function()
57+
require('dap').toggle_breakpoint()
58+
end,
59+
desc = 'Debug: Toggle Breakpoint',
60+
},
61+
{
62+
'<leader>B',
63+
function()
64+
require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ')
65+
end,
66+
desc = 'Debug: Set Breakpoint',
67+
},
68+
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
69+
{
70+
'<F7>',
71+
function()
72+
require('dapui').toggle()
73+
end,
74+
desc = 'Debug: See last session result.',
75+
},
76+
},
4677
config = function()
4778
local dap = require 'dap'
4879
local dapui = require 'dapui'

0 commit comments

Comments
 (0)