From c20a8499c5502657adcda330aa7f2a62d209b594 Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Sat, 15 Jul 2023 00:31:49 -0700 Subject: [PATCH] Some changes to file finding and adding a debugger --- lua/conf/keybinds.lua | 12 ++++++++++++ lua/conf/langs/debugging.lua | 5 +++++ lua/conf/langs/rust.lua | 7 +++++++ lua/conf/plugins.lua | 3 +++ lua/conf/ui.lua | 25 ++++++++++++++++++++++++- 5 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 lua/conf/langs/debugging.lua diff --git a/lua/conf/keybinds.lua b/lua/conf/keybinds.lua index 0240b6c..91f0457 100644 --- a/lua/conf/keybinds.lua +++ b/lua/conf/keybinds.lua @@ -57,3 +57,15 @@ vim.api.nvim_set_keymap( [[:let _s=@/:%s/\s\+$//e:let @/=_s:nohl]], keymap_opts) + +-- vimspector keybinds +vim.keymap.set('n', '', 'call vimspector#Launch()') +vim.keymap.set('n', '', 'call vimspector#StepOver()') +vim.keymap.set('n', '', 'call vimspector#Reset()') +vim.keymap.set('n', '', 'call vimspector#StepOver()') +vim.keymap.set('n', '', 'call vimspector#StepOut()') +vim.keymap.set('n', '', 'call vimspector#StepInto()') + +vim.keymap.set('n', "Db", ":call vimspector#ToggleBreakpoint()") +vim.keymap.set('n', "Dw", ":call vimspector#AddWatch()") +vim.keymap.set('n', "De", ":call vimspector#Evaluate()") diff --git a/lua/conf/langs/debugging.lua b/lua/conf/langs/debugging.lua new file mode 100644 index 0000000..afa2cef --- /dev/null +++ b/lua/conf/langs/debugging.lua @@ -0,0 +1,5 @@ +-- vimspector configuration + +vim.g.vimspector_sidebar_width = 65 +vim.g.vimspector_sidebar_height = 15 +vim.g.vimspector_terminal_maxwidth = 70 diff --git a/lua/conf/langs/rust.lua b/lua/conf/langs/rust.lua index bcda183..10ee9d5 100644 --- a/lua/conf/langs/rust.lua +++ b/lua/conf/langs/rust.lua @@ -8,5 +8,12 @@ rt.setup({ -- Code action groups vim.keymap.set("n", "a", rt.code_action_group.code_action_group, { buffer = bufnr }) end, + settings = { + ['rust-analyzer'] = { + checkOnSave = { + command = "clippy" + } + } + } }, }) diff --git a/lua/conf/plugins.lua b/lua/conf/plugins.lua index a365797..2f4ad82 100644 --- a/lua/conf/plugins.lua +++ b/lua/conf/plugins.lua @@ -73,6 +73,9 @@ Plug 'skywind3000/asyncrun.vim' -- Syntax highlighting Plug 'sheerun/vim-polyglot' +-- Debugging +Plug 'puremourning/vimspector' + -- Languages ------------------------- diff --git a/lua/conf/ui.lua b/lua/conf/ui.lua index ad373ed..2969637 100644 --- a/lua/conf/ui.lua +++ b/lua/conf/ui.lua @@ -14,7 +14,30 @@ require('telescope').setup{ pickers = { find_files = { theme = "dropdown", + hidden = true, + prompt_prefix=🔍, + file_ignore_patterns = { + ".git/", + ".cache", + "%.o", + "%.a", + "%.out", + "%.class", + "%.pdf", + "%.mkv", + "%.mp4", + "%.zip" + }, } }, - extensions = {} + extensions = { + fzf = { + fuzzy = true, + override_generic_sorter = true, + override_file_sorter = true, + case_mode = "smart_case", + } + } } + +require('telescope').load_extension('fzf')