Compare commits
3 commits
4bca412800
...
98239d82c7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98239d82c7 | ||
|
|
c1be56ea1a | ||
|
|
50116c99af |
|
|
@ -9,7 +9,7 @@ in {
|
|||
u.bin = with pkgs;
|
||||
{
|
||||
edit = [];
|
||||
sh-tmux = [tmux];
|
||||
auto-tmux = [tmux];
|
||||
sm = [];
|
||||
}
|
||||
// lib.optionalAttrs config.u.has.graphical {
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ local parent="$(ps -o command= -p "$PPID" | cut -f1 -d' ')"
|
|||
if [[ "$parent" == *alacritty ]]; then
|
||||
if [[ -z "$TMUX" && -z "$NOTMUX" ]]; then
|
||||
if [[ "$PWD" == "$HOME" ]]; then
|
||||
exec sh-tmux
|
||||
exec auto-tmux
|
||||
else
|
||||
exec sh-tmux -n
|
||||
exec auto-tmux -n
|
||||
fi
|
||||
fi
|
||||
# set shell level
|
||||
|
|
|
|||
|
|
@ -20,9 +20,10 @@
|
|||
vim-sleuth
|
||||
catppuccin-nvim
|
||||
tokyonight-nvim
|
||||
gitsigns-nvim
|
||||
];
|
||||
extraPackages = with pkgs; [
|
||||
basedpyright
|
||||
python3Packages.jedi-language-server
|
||||
clang-tools
|
||||
nixd
|
||||
];
|
||||
|
|
|
|||
|
|
@ -2,6 +2,54 @@ local lspconfig = require('lspconfig')
|
|||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('u-lsp-attach', { clear = true }),
|
||||
callback = function(event)
|
||||
local map = function(keys, func, desc, mode)
|
||||
mode = mode or 'n'
|
||||
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
||||
end
|
||||
|
||||
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
||||
map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||
map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
||||
map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
|
||||
map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
||||
map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
||||
map('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
||||
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' })
|
||||
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||
|
||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then
|
||||
local highlight_augroup = vim.api.nvim_create_augroup('u-lsp-highlight', { clear = false })
|
||||
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.document_highlight,
|
||||
})
|
||||
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.clear_references,
|
||||
})
|
||||
vim.api.nvim_create_autocmd('LspDetach', {
|
||||
group = vim.api.nvim_create_augroup('u-lsp-detach', { clear = true }),
|
||||
callback = function(event2)
|
||||
vim.lsp.buf.clear_references()
|
||||
vim.api.nvim_clear_autocmds { group = 'u-lsp-highlight', buffer = event2.buf }
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then
|
||||
map('<leader>th', function()
|
||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
|
||||
end, '[T]oggle Inlay [H]ints')
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
lspconfig.clangd.setup({
|
||||
cmd = {
|
||||
"clangd",
|
||||
|
|
@ -13,5 +61,5 @@ lspconfig.clangd.setup({
|
|||
},
|
||||
capabilities=capabilities
|
||||
})
|
||||
lspconfig.basedpyright.setup{}
|
||||
lspconfig.jedi_language_server.setup{}
|
||||
lspconfig.nixd.setup{}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ vim.opt.scrolloff = 8
|
|||
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
desc = 'Highlight when yanking (copying) text',
|
||||
group = vim.api.nvim_create_augroup('highlight-yank', { clear = true }),
|
||||
group = vim.api.nvim_create_augroup('u-highlight-yank', { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
|
|
@ -57,3 +57,16 @@ statusline.section_location = function()
|
|||
return '%2l:%-2v'
|
||||
end
|
||||
vim.cmd.colorscheme 'tokyonight-storm'
|
||||
|
||||
require('gitsigns').setup({
|
||||
signs = {
|
||||
add = { text = '+' },
|
||||
change = { text = '*' },
|
||||
},
|
||||
})
|
||||
|
||||
require('nvim-treesitter.configs').setup({
|
||||
highlight = {
|
||||
enable = true
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ bind m resize-pane -Z
|
|||
|
||||
# detach (sends signal to parent process to exec shell)
|
||||
unbind d
|
||||
bind d run 'sh-tmux -d'
|
||||
bind d run 'auto-tmux -d'
|
||||
set -g update-environment SH_TMUX_PID
|
||||
|
||||
bind C-u copy-mode \; send C-u
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@
|
|||
adwaita-icon-theme
|
||||
bluetuith
|
||||
globalprotect-openconnect
|
||||
virt-viewer
|
||||
]
|
||||
++ lib.optionals config.u.has.wine [
|
||||
wineWowPackages.stable
|
||||
|
|
|
|||
Loading…
Reference in a new issue