add which-key
This commit is contained in:
@@ -8,16 +8,15 @@ vim.opt.relativenumber = false
|
||||
vim.opt.number = true
|
||||
|
||||
local builtin = require("telescope.builtin")
|
||||
vim.keymap.set("n", "<leader>ff", builtin.find_files, {})
|
||||
vim.keymap.set("n", "<leader>fg", builtin.live_grep, {})
|
||||
vim.keymap.set("n", "<leader>fb", builtin.buffers, {})
|
||||
vim.keymap.set("n", "<leader>fh", builtin.help_tags, {})
|
||||
vim.keymap.set("n", "<leader>ff", builtin.find_files, { desc = "Find files" })
|
||||
vim.keymap.set("n", "<leader>fg", builtin.live_grep, { desc = "Live grep files" })
|
||||
vim.keymap.set("n", "<leader>fb", builtin.buffers, { desc = "Find buffers" })
|
||||
vim.keymap.set("n", "<leader>fh", builtin.help_tags, { desc = "Help tags" })
|
||||
|
||||
vim.keymap.set("n", "<leader>F", function()
|
||||
require("conform").format({ async = true })
|
||||
end, {})
|
||||
|
||||
vim.keymap.set("n", "<leader>n", ":BufferLineCycleNext<CR>", {})
|
||||
vim.keymap.set("n", "<leader>b", ":BufferLineCyclePrev<CR>", {})
|
||||
vim.keymap.set("n", "<leader>q", ":bd<CR>", {})
|
||||
end, { desc = "Format file" })
|
||||
|
||||
vim.keymap.set("n", "<leader>n", ":BufferLineCycleNext<CR>", { desc = "Go to the next buffer" })
|
||||
vim.keymap.set("n", "<leader>b", ":BufferLineCyclePrev<CR>", { desc = "Go to the previous buffer" })
|
||||
vim.keymap.set("n", "<leader>q", ":bd<CR>", { desc = "Close current buffer" })
|
||||
|
||||
@@ -33,4 +33,3 @@ require("lazy").setup({
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
})
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
return {
|
||||
'saghen/blink.cmp',
|
||||
"saghen/blink.cmp",
|
||||
-- optional: provides snippets for the snippet source
|
||||
--dependencies = { 'rafamadriz/friendly-snippets' },
|
||||
|
||||
-- use a release tag to download pre-built binaries
|
||||
version = '1.*',
|
||||
version = "1.*",
|
||||
-- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
|
||||
-- build = 'cargo build --release',
|
||||
-- If you use nix, you can build from source using latest nightly rust with:
|
||||
@@ -25,12 +25,12 @@ return {
|
||||
-- C-k: Toggle signature help (if signature.enabled = true)
|
||||
--
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
keymap = { preset = 'super-tab' },
|
||||
keymap = { preset = "super-tab" },
|
||||
|
||||
appearance = {
|
||||
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||
-- Adjusts spacing to ensure icons are aligned
|
||||
nerd_font_variant = 'mono'
|
||||
nerd_font_variant = "mono",
|
||||
},
|
||||
|
||||
-- (Default) Only show the documentation popup when manually triggered
|
||||
@@ -39,7 +39,7 @@ return {
|
||||
-- Default list of enabled providers defined so that you can extend it
|
||||
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||
default = { "lsp", "path", "snippets", "buffer" },
|
||||
},
|
||||
|
||||
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||
@@ -47,8 +47,7 @@ return {
|
||||
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
||||
--
|
||||
-- See the fuzzy documentation for more information
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" }
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" },
|
||||
},
|
||||
opts_extend = { "sources.default" }
|
||||
opts_extend = { "sources.default" },
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ return {
|
||||
buffer_close_icon = "X",
|
||||
|
||||
modified_icon = "U",
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -6,4 +6,3 @@ return {
|
||||
vim.cmd([[colorscheme catppuccin-macchiato]])
|
||||
end,
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@ return {
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
python = { "black" },
|
||||
c = { "clang-format" }
|
||||
c = { "clang-format" },
|
||||
lua = { "stylua" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
return {
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = { 'saghen/blink.cmp' },
|
||||
|
||||
-- example using `opts` for defining servers
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = { "saghen/blink.cmp" },
|
||||
opts = {
|
||||
servers = {
|
||||
clangd = {},
|
||||
}
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
local lspconfig = require('lspconfig')
|
||||
local lspconfig = require("lspconfig")
|
||||
for server, config in pairs(opts.servers) do
|
||||
-- passing config.capabilities to blink.cmp merges with the capabilities in your
|
||||
-- `opts[server].capabilities, if you've defined it
|
||||
config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities)
|
||||
config.capabilities = require("blink.cmp").get_lsp_capabilities(config.capabilities)
|
||||
lspconfig[server].setup(config)
|
||||
end
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function ()
|
||||
config = function()
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
|
||||
configs.setup({
|
||||
@@ -10,6 +10,5 @@ return {
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
tag = "0.1.8",
|
||||
dependencies = { "nvim-lua/plenary.nvim" }
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
}
|
||||
|
||||
10
.config/nvim/lua/plugins/which-key.lua
Normal file
10
.config/nvim/lua/plugins/which-key.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
},
|
||||
keys = {},
|
||||
}
|
||||
13
README.md
13
README.md
@@ -7,19 +7,12 @@ My personal dotfiles!
|
||||
## Requirements
|
||||
- [ripgrep](https://github.com/BurntSushi/ripgrep)
|
||||
- clangd
|
||||
- stylua
|
||||
- Optional
|
||||
|
||||
## Installation
|
||||
Just copy the folders under `.config` in your `$HOME/.config/`.
|
||||
|
||||
## Keybindings
|
||||
The leader key is the `Space`.
|
||||
|
||||
`<leader>ff` - Find files
|
||||
`<leader>fg` - Live grep
|
||||
`<leader>fb` - Show buffers
|
||||
`<leader>fh` - Help tags
|
||||
`<leader>F` - Format file (only works with C files)
|
||||
`<leader>q` - Quit buffer
|
||||
`<leader>n` - Next buffer
|
||||
`<ledaer>b` - Previous buffer
|
||||
The leader key is the `Space`. Press it to show all the keybindings.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user