WhichKey, ToggleTerm, Silicon
This commit is contained in:
parent
edf06af994
commit
0720451fe6
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.DS_Store
|
@ -8,6 +8,7 @@
|
||||
};
|
||||
profileExtra = ''
|
||||
set -o vi
|
||||
bind "set show-mode-in-prompt on"
|
||||
[ ! -z $TMUX ] || tmux a || tmux
|
||||
neofetch
|
||||
'';
|
||||
|
@ -1392,7 +1392,7 @@
|
||||
<key>Minimum Contrast</key>
|
||||
<real>0.4030938720703125</real>
|
||||
<key>Mouse Reporting</key>
|
||||
<false/>
|
||||
<true/>
|
||||
<key>Name</key>
|
||||
<string>Default</string>
|
||||
<key>Non Ascii Font</key>
|
||||
|
@ -9,6 +9,9 @@ vim.cmd('colorscheme nord')
|
||||
vim.keymap.set("n", "<Space>", "<Nop>", {silent = true})
|
||||
vim.g.mapleader = " "
|
||||
|
||||
-- Set Timeout
|
||||
vim.opt.timeoutlen = 250
|
||||
|
||||
-- Disable NetRW
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
@ -7,8 +7,11 @@ require('leap-config')
|
||||
require('lsp-config')
|
||||
require('lsp-lines-config')
|
||||
require('lualine-config')
|
||||
require('null-ls-config')
|
||||
require('noice-config')
|
||||
require('null-ls-config')
|
||||
require('numb-config')
|
||||
require('silicon-config')
|
||||
require('telescope-config')
|
||||
require('toggleterm-config')
|
||||
require('ts-config')
|
||||
require('which-key-config')
|
||||
|
@ -2,25 +2,16 @@ local nix_vars = require("nix-vars")
|
||||
local nvim_lsp = require('lspconfig')
|
||||
|
||||
local on_attach = function(client, bufnr)
|
||||
-- Mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local bufopts = {noremap = true, silent = true, buffer = bufnr}
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder,
|
||||
bufopts)
|
||||
vim.keymap.set('n', '<space>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, bufopts)
|
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set('n', '<space>f',
|
||||
vim.keymap.set('n', '<leader>lD', vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set('n', '<leader>ld', vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set('n', '<leader>li', vim.lsp.buf.implementation, bufopts)
|
||||
vim.keymap.set('n', '<leader>ln', vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set('n', '<leader>lr', vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set('n', '<leader>lt', vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set('n', '<leader>lf',
|
||||
function() vim.lsp.buf.format {async = true} end, bufopts)
|
||||
end
|
||||
|
||||
|
10
nvim/config/lua/silicon-config.lua
Normal file
10
nvim/config/lua/silicon-config.lua
Normal file
@ -0,0 +1,10 @@
|
||||
local silicon = require('silicon')
|
||||
silicon.setup({})
|
||||
|
||||
vim.keymap.set('v', '<Leader>ss', function() silicon.visualise_api({}) end)
|
||||
vim.keymap.set('v', '<Leader>sb',
|
||||
function() silicon.visualise_api({show_buf = true}) end)
|
||||
vim.keymap.set('n', '<Leader>sv',
|
||||
function() silicon.visualise_api({visible = true}) end)
|
||||
vim.keymap.set('n', '<Leader>sb',
|
||||
function() silicon.visualise_api({show_buf = true}) end)
|
11
nvim/config/lua/toggleterm-config.lua
Normal file
11
nvim/config/lua/toggleterm-config.lua
Normal file
@ -0,0 +1,11 @@
|
||||
require("toggleterm").setup({open_mapping = [[<c-\>]]})
|
||||
|
||||
-- Duplicate C-w & Esc Behavior
|
||||
function _G.set_terminal_keymaps()
|
||||
local opts = {buffer = 0}
|
||||
vim.opt.signcolumn = "no"
|
||||
vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], opts)
|
||||
vim.keymap.set('t', '<C-w>', [[<C-\><C-n><C-w>]], opts)
|
||||
end
|
||||
|
||||
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
|
36
nvim/config/lua/which-key-config.lua
Normal file
36
nvim/config/lua/which-key-config.lua
Normal file
@ -0,0 +1,36 @@
|
||||
local wk = require("which-key")
|
||||
|
||||
wk.setup({})
|
||||
|
||||
wk.register({
|
||||
K = {"Definition Hover"},
|
||||
["<C-k>"] = {"Signature Help"},
|
||||
["<leader>"] = {
|
||||
q = {"Show Diagnostics"},
|
||||
e = {"Show Line Diagnostics"},
|
||||
f = {
|
||||
name = "Find - Telescope",
|
||||
f = {"<cmd>Telescope find_files<cr>", "Find File"},
|
||||
g = {"<cmd>Telescope live_grep<cr>", "Live Grep"},
|
||||
b = {"<cmd>Telescope buffers<cr>", "Find Buffer"},
|
||||
h = {"<cmd>Telescope help_tags<cr>", "Help Tags"}
|
||||
},
|
||||
l = {
|
||||
name = "LSP",
|
||||
D = {"Declaration"},
|
||||
d = {"Definition"},
|
||||
f = {"Format"},
|
||||
i = {"Implementation"},
|
||||
n = {"Rename"},
|
||||
r = {"References"},
|
||||
t = {"Type Definition"}
|
||||
},
|
||||
s = {
|
||||
name = "Screenshot",
|
||||
mode = {'v', 'n'},
|
||||
b = {"Buffer Screenshot", mode = {'v', 'n'}},
|
||||
s = {"Selected Screenshot", mode = 'v'},
|
||||
v = {"Visual Screenshot", mode = 'n'}
|
||||
}
|
||||
}
|
||||
})
|
@ -39,14 +39,16 @@ in
|
||||
nvim-autopairs # Automatically Close Pairs (),[],{}
|
||||
telescope-fzf-native-nvim # Faster Telescope
|
||||
telescope-nvim # Fuzzy Finder
|
||||
toggleterm-nvim # Terminal Helper
|
||||
vim-nix # Nix Helpers
|
||||
which-key-nvim # Shortcut Helper
|
||||
|
||||
# ------------------
|
||||
# --- Theme / UI ---
|
||||
# ------------------
|
||||
nord-nvim # Theme
|
||||
lualine-nvim # Bottom Line
|
||||
noice-nvim # UI Tweaks
|
||||
nord-nvim # Theme
|
||||
nvim-web-devicons # Dev Icons
|
||||
|
||||
# ------------------
|
||||
@ -63,6 +65,23 @@ in
|
||||
)
|
||||
)
|
||||
|
||||
# ------------------
|
||||
# ----- Silicon ----
|
||||
# ------------------
|
||||
(
|
||||
pkgs.vimUtils.buildVimPluginFrom2Nix {
|
||||
pname = "silicon.lua";
|
||||
version = "2022-12-03";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "0oAstro";
|
||||
repo = "silicon.lua";
|
||||
rev = "8db5682c9c13d6de584551c4b2b9982709f05610";
|
||||
sha256 = "0148l59wrffmfw4xya0l1ys277hgrm41wspgp0ns2dddsr11mwav";
|
||||
};
|
||||
meta.homepage = "https://github.com/0oAstro/silicon.lua/";
|
||||
}
|
||||
)
|
||||
|
||||
];
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
@ -83,6 +102,9 @@ in
|
||||
nodePackages.prettier
|
||||
sqlfluff
|
||||
|
||||
# Silicon
|
||||
silicon
|
||||
|
||||
];
|
||||
|
||||
extraConfig = ":luafile ~/.config/nvim/lua/init.lua";
|
||||
|
@ -4,12 +4,9 @@
|
||||
programs.readline = {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
# Show Prompt
|
||||
set show-mode-in-prompt on
|
||||
|
||||
# Approximate VIM Dracula Colors
|
||||
set vi-ins-mode-string \1\e[01;38;5;23;48;5;231m\2 INS \1\e[38;5;231;48;5;238m\2\1\e[0m\2
|
||||
set vi-cmd-mode-string \1\e[01;38;5;22;48;5;148m\2 CMD \1\e[38;5;148;48;5;238m\2\1\e[0m\2
|
||||
set vi-ins-mode-string \1\e[01;38;5;23;48;5;231m\2 I \1\e[38;5;231;48;5;238m\2\1\e[0m\2
|
||||
set vi-cmd-mode-string \1\e[01;38;5;22;48;5;148m\2 C \1\e[38;5;148;48;5;238m\2\1\e[0m\2
|
||||
'';
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user