Browse Source

feat: updates to keybinds

master
Tovi Jaeschke-Rogers 3 weeks ago
parent
commit
b5fe2f85f7
6 changed files with 182 additions and 22 deletions
  1. +73
    -5
      .config/nvim/lua/plugins/blink.lua
  2. +38
    -1
      .config/nvim/lua/plugins/colorscheme.lua
  3. +1
    -1
      .config/nvim/lua/plugins/dadbod.lua
  4. +1
    -0
      .config/nvim/lua/plugins/lualine.lua
  5. +23
    -4
      .config/nvim/lua/plugins/notify.lua
  6. +46
    -11
      .config/nvim/lua/plugins/telescope.lua

+ 73
- 5
.config/nvim/lua/plugins/blink.lua View File

@ -1,6 +1,6 @@
return { return {
'saghen/blink.cmp', 'saghen/blink.cmp',
lazy = false,
event = { "InsertEnter", "CmdlineEnter" },
dependencies = { dependencies = {
{ 'rafamadriz/friendly-snippets' }, { 'rafamadriz/friendly-snippets' },
{ 'kristijanhusak/vim-dadbod-completion', ft = { 'sql', 'mysql', 'plsql' }, lazy = true }, { 'kristijanhusak/vim-dadbod-completion', ft = { 'sql', 'mysql', 'plsql' }, lazy = true },
@ -10,11 +10,17 @@ return {
version = '1.*', version = '1.*',
opts = { opts = {
completion = { completion = {
accept = {
auto_brackets = {
enabled = true,
},
},
menu = { menu = {
auto_show = true, auto_show = true,
winblend = vim.o.pumblend, winblend = vim.o.pumblend,
scrollbar = true, scrollbar = true,
border = 'single', border = 'single',
max_items = 200,
draw = { draw = {
columns = { columns = {
{ "label", "label_description", gap = 1 }, { "label", "label_description", gap = 1 },
@ -30,13 +36,15 @@ return {
return 'BlinkCmpKind' .. ctx.kind return 'BlinkCmpKind' .. ctx.kind
end, end,
} }
}
},
treesitter = { "lsp" }
} }
}, },
documentation = { documentation = {
auto_show = true, auto_show = true,
auto_show_delay_ms = 200, -- Faster doc display
auto_show_delay_ms = 200,
update_delay_ms = 50,
window = { window = {
border = 'single', border = 'single',
winblend = vim.o.pumblend, winblend = vim.o.pumblend,
@ -45,7 +53,9 @@ return {
} }
}, },
ghost_text = { enabled = false },
ghost_text = {
enabled = vim.g.ai_cmp or false,
},
}, },
appearance = { appearance = {
@ -64,14 +74,72 @@ return {
}, },
providers = { providers = {
dadbod = { name = "Dadbod", module = "vim_dadbod_completion.blink" },
dadbod = {
name = "Dadbod",
module = "vim_dadbod_completion.blink",
score_offset = 85,
},
laravel = { laravel = {
name = "laravel", name = "laravel",
module = "blink.compat.source", module = "blink.compat.source",
score_offset = 80,
},
lsp = {
name = "LSP",
module = "blink.cmp.sources.lsp",
score_offset = 90,
},
path = {
name = "Path",
module = "blink.cmp.sources.path",
score_offset = 3,
opts = {
trailing_slash = false,
label_trailing_slash = true,
get_cwd = function(context) return vim.fn.getcwd() end,
show_hidden_files_by_default = true,
}
},
snippets = {
name = "Snippets",
module = "blink.cmp.sources.snippets",
score_offset = 85,
opts = {
friendly_snippets = true,
search_paths = { vim.fn.stdpath("config") .. "/snippets" },
global_snippets = { "all" },
extended_filetypes = {},
ignored_filetypes = {},
}
},
buffer = {
name = "Buffer",
module = "blink.cmp.sources.buffer",
opts = {
max_items = 5,
keyword_length = 2,
}
},
cmdline = {
name = "Cmdline",
module = "blink.cmp.sources.cmdline",
}, },
}, },
}, },
cmdline = {
sources = function()
local type = vim.fn.getcmdtype()
if type == "/" or type == "?" then
return { 'buffer' }
end
if type == ":" then
return { 'cmdline' }
end
return {}
end,
},
signature = { signature = {
enabled = true, enabled = true,
window = { window = {


+ 38
- 1
.config/nvim/lua/plugins/colorscheme.lua View File

@ -84,7 +84,44 @@ return {
"EdenEast/nightfox.nvim", "EdenEast/nightfox.nvim",
lazy = false, lazy = false,
priority = 1000, priority = 1000,
config = function()
opts = {
options = {
compile_path = vim.fn.stdpath("cache") .. "/nightfox",
compile_file_suffix = "_compiled",
transparent = false,
terminal_colors = true,
dim_inactive = false,
module_default = true,
colorblind = {
enable = false,
simulate_only = false,
severity = {
protan = 0,
deutan = 0,
tritan = 0,
},
},
styles = {
comments = "italic",
conditionals = "NONE",
constants = "NONE",
functions = "NONE",
keywords = "NONE",
numbers = "NONE",
operators = "NONE",
strings = "NONE",
types = "NONE",
variables = "NONE",
},
inverse = {
match_paren = false,
visual = false,
search = false,
},
}
},
config = function(_, opts)
require("nightfox").setup(opts)
vim.cmd("colorscheme carbonfox") vim.cmd("colorscheme carbonfox")
end end
} }


+ 1
- 1
.config/nvim/lua/plugins/dadbod.lua View File

@ -16,7 +16,7 @@ return {
vim.g.db_ui_auto_execute_table_helpers = 1 vim.g.db_ui_auto_execute_table_helpers = 1
vim.g.dbs = { vim.g.dbs = {
dev = 'mariadb://jack:secret@localhost:33061/jack?ssl=false',
dev = 'mysql://jack:secret@localhost:33061/jack?protocol=tcp',
} }
vim.api.nvim_create_user_command('DBUITab', function() vim.api.nvim_create_user_command('DBUITab', function()


+ 1
- 0
.config/nvim/lua/plugins/lualine.lua View File

@ -1,5 +1,6 @@
return { return {
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
event = "VeryLazy",
dependencies = { dependencies = {
"nvim-tree/nvim-web-devicons", "nvim-tree/nvim-web-devicons",
"letieu/harpoon-lualine", "letieu/harpoon-lualine",


+ 23
- 4
.config/nvim/lua/plugins/notify.lua View File

@ -1,7 +1,26 @@
return { return {
"rcarriga/nvim-notify", "rcarriga/nvim-notify",
lazy = false,
config = function ()
vim.notify = require("notify")
end
event = "VeryLazy",
opts = {
background_colour = "#000000",
fps = 30,
icons = {
DEBUG = "",
ERROR = "",
INFO = "",
TRACE = "",
WARN = ""
},
level = 2,
minimum_width = 50,
render = "default",
stages = "fade_in_slide_out",
timeout = 5000,
top_down = true
},
config = function(_, opts)
local notify = require("notify")
notify.setup(opts)
vim.notify = notify
end,
} }

+ 46
- 11
.config/nvim/lua/plugins/telescope.lua View File

@ -1,11 +1,13 @@
return { return {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
cmd = "Telescope",
dependencies = { dependencies = {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", "nvim-tree/nvim-web-devicons",
"debugloop/telescope-undo.nvim", "debugloop/telescope-undo.nvim",
"nvim-telescope/telescope-ui-select.nvim", "nvim-telescope/telescope-ui-select.nvim",
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, { "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
"nvim-telescope/telescope-live-grep-args.nvim",
}, },
config = function() config = function()
local telescope = require("telescope") local telescope = require("telescope")
@ -64,6 +66,20 @@ return {
picker(opts) picker(opts)
end end
-- Visual selection live grep
local function grep_string_visual()
vim.cmd('noau normal! "vy"')
local text = vim.fn.getreg('v')
vim.fn.setreg('v', {})
text = string.gsub(text, "\n", "")
if #text > 0 then
builtin.live_grep({ default_text = text })
else
builtin.live_grep()
end
end
-- Telescope setup -- Telescope setup
telescope.setup({ telescope.setup({
defaults = { defaults = {
@ -159,6 +175,18 @@ return {
override_file_sorter = true, override_file_sorter = true,
case_mode = "smart_case", case_mode = "smart_case",
}, },
live_grep_args = {
auto_quoting = true,
mappings = {
i = {
["<C-k>"] = require("telescope-live-grep-args.actions").quote_prompt(),
["<C-i>"] = require("telescope-live-grep-args.actions").quote_prompt({ postfix = " --iglob " }),
},
},
},
["ui-select"] = {
require("telescope.themes").get_dropdown(),
},
}, },
}) })
@ -166,6 +194,7 @@ return {
telescope.load_extension("fzf") telescope.load_extension("fzf")
telescope.load_extension("undo") telescope.load_extension("undo")
telescope.load_extension("ui-select") telescope.load_extension("ui-select")
telescope.load_extension("live_grep_args")
-- Keymaps -- Keymaps
local function map(mode, lhs, rhs, desc) local function map(mode, lhs, rhs, desc)
@ -174,6 +203,10 @@ return {
-- File navigation -- File navigation
map("n", "<leader>ff", function() map("n", "<leader>ff", function()
require("telescope").extensions.live_grep_args.live_grep_args()
end, "Live grep with args")
map("n", "<leader>fg", function()
require("plugins.telescope.multigrep").live_multgrep() require("plugins.telescope.multigrep").live_multgrep()
end, "Live multigrep") end, "Live multigrep")
@ -181,17 +214,20 @@ return {
map("n", "<leader>fr", builtin.resume, "Resume last telescope") map("n", "<leader>fr", builtin.resume, "Resume last telescope")
map("n", "<leader>fb", builtin.buffers, "Find buffers") map("n", "<leader>fb", builtin.buffers, "Find buffers")
map("n", "<leader>fo", builtin.oldfiles, "Find recent files") map("n", "<leader>fo", builtin.oldfiles, "Find recent files")
map("n", "<leader>fc", builtin.commands, "Find commands")
-- Search -- Search
map("n", "<leader>gf", function()
map("n", "<leader>fw", function()
builtin.grep_string({ search = vim.fn.expand("<cword>") }) builtin.grep_string({ search = vim.fn.expand("<cword>") })
end, "Grep word under cursor") end, "Grep word under cursor")
map("n", "<leader>gF", function()
map("n", "<leader>fW", function()
builtin.grep_string({ search = vim.fn.expand("<cWORD>") }) builtin.grep_string({ search = vim.fn.expand("<cWORD>") })
end, "Grep WORD under cursor") end, "Grep WORD under cursor")
map("n", "<leader>gD", function()
map("v", "<leader>fw", grep_string_visual, "Grep selection")
map("n", "<leader>fF", function()
builtin.find_files({ search_file = vim.fn.expand("<cword>") }) builtin.find_files({ search_file = vim.fn.expand("<cword>") })
end, "Find file with name under cursor") end, "Find file with name under cursor")
@ -214,15 +250,14 @@ return {
map("n", "<leader>dws", builtin.lsp_dynamic_workspace_symbols, "Dynamic workspace symbols") map("n", "<leader>dws", builtin.lsp_dynamic_workspace_symbols, "Dynamic workspace symbols")
-- Utilities -- Utilities
map("n", "<leader>u", "<cmd>Telescope undo<cr>", "Undo history")
map("n", "<leader>ss", builtin.spell_suggest, "Spell suggestions")
map("n", "<leader>m", builtin.marks, "Marks")
map("n", "<leader>cc", builtin.commands, "Commands")
map("n", "<leader>ch", builtin.command_history, "Command history")
map("n", "<leader>vh", builtin.help_tags, "Help tags")
map("n", "<leader>fu", "<cmd>Telescope undo<cr>", "Undo history")
map("n", "<leader>fs", builtin.spell_suggest, "Spell suggestions")
map("n", "<leader>fm", builtin.marks, "Marks")
map("n", "<leader>fh", builtin.command_history, "Command history")
map("n", "<leader>fH", builtin.help_tags, "Help tags")
-- Quickfix -- Quickfix
map("n", "<leader>ql", builtin.quickfix, "Quickfix list")
map("n", "<leader>qhl", builtin.quickfixhistory, "Quickfix history")
map("n", "<leader>fq", builtin.quickfix, "Quickfix list")
map("n", "<leader>fQ", builtin.quickfixhistory, "Quickfix history")
end, end,
} }

Loading…
Cancel
Save