WIP: Switch to NixOS #5
5 changed files with 19 additions and 14 deletions
|
@ -1,4 +1,3 @@
|
||||||
require("keybinds")
|
|
||||||
require("settings")
|
require("settings")
|
||||||
require("neovide")
|
require("neovide")
|
||||||
require("highlight_yank")
|
require("highlight_yank")
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
local map = vim.keymap.set
|
|
||||||
|
|
||||||
-- Navigate between buffers
|
|
||||||
map("n", "<C-N>", vim.cmd.bn, { silent = true })
|
|
||||||
map("n", "<C-B>", vim.cmd.bp, { silent = true })
|
|
||||||
|
|
||||||
-- Run Neoformat
|
|
||||||
map("n", "<M-f>", vim.cmd.Neoformat, {})
|
|
||||||
|
|
||||||
-- Exit terminal insert mode with esc
|
|
||||||
map("t", "<Esc>", "<C-\\><C-n>", {})
|
|
|
@ -79,7 +79,7 @@ local plugins = {
|
||||||
"lambdalisue/suda.vim",
|
"lambdalisue/suda.vim",
|
||||||
|
|
||||||
-- Display possible keybinds
|
-- Display possible keybinds
|
||||||
{ "folke/which-key.nvim", config = true },
|
{ "folke/which-key.nvim", config = require("plugins.which-key") },
|
||||||
|
|
||||||
-- Package manager for LSP servers, DAP adapters etc.
|
-- Package manager for LSP servers, DAP adapters etc.
|
||||||
{
|
{
|
||||||
|
|
|
@ -83,7 +83,7 @@ function m.map_keys()
|
||||||
rn = { vim.lsp.buf.rename, "Rename symbol" },
|
rn = { vim.lsp.buf.rename, "Rename symbol" },
|
||||||
ca = { vim.lsp.buf.code_action, "Code action" },
|
ca = { vim.lsp.buf.code_action, "Code action" },
|
||||||
e = { vim.diagnostic.open_float, "Open diagnostics" },
|
e = { vim.diagnostic.open_float, "Open diagnostics" },
|
||||||
f = { vim.lsp.buf.format, "Format" },
|
F = { vim.lsp.buf.format, "Format with LSP" },
|
||||||
},
|
},
|
||||||
K = { vim.lsp.buf.hover, "Hover" },
|
K = { vim.lsp.buf.hover, "Hover" },
|
||||||
["["] = { d = { vim.diagnostic.goto_prev, "Previous diagnostic" } },
|
["["] = { d = { vim.diagnostic.goto_prev, "Previous diagnostic" } },
|
||||||
|
|
17
home/.config/nvim/lua/plugins/which-key.lua
Normal file
17
home/.config/nvim/lua/plugins/which-key.lua
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
return function()
|
||||||
|
local wk = require("which-key")
|
||||||
|
wk.setup({})
|
||||||
|
|
||||||
|
wk.register({
|
||||||
|
f = { "<cmd>Neoformat<CR>", "Format with Neoformat" },
|
||||||
|
h = { "<cmd>nohlsearch<CR>", "Turn off search highlight" },
|
||||||
|
}, { prefix = "<leader>" })
|
||||||
|
|
||||||
|
wk.register({
|
||||||
|
["<C-n>"] = { "<cmd>bnext<CR>", "Next buffer" },
|
||||||
|
["<C-b>"] = { "<cmd>bprevious<CR>", "Previous buffer" },
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Exit terminal insert mode with esc
|
||||||
|
vim.keymap.set("t", "<Esc>", "<C-\\><C-n>", {})
|
||||||
|
end
|
Loading…
Add table
Add a link
Reference in a new issue