Compare commits
No commits in common. "22fb88076334de324d38b3dfbaa6371f35154a18" and "26e0c95b780b145384744d15ceb79c7acc0935b8" have entirely different histories.
22fb880763
...
26e0c95b78
15
bash/.bashrc
15
bash/.bashrc
|
@ -32,17 +32,18 @@ export GPG_TTY=$(tty)
|
||||||
export VISUAL="$(command -v nvim 2>/dev/null)"
|
export VISUAL="$(command -v nvim 2>/dev/null)"
|
||||||
export EDITOR="$(command -v nvim 2>/dev/null || command -v vim 2>/dev/null || command -v nano)"
|
export EDITOR="$(command -v nvim 2>/dev/null || command -v vim 2>/dev/null || command -v nano)"
|
||||||
[ -x "$(command -v nvim 2> /dev/null)" ] && alias vim='nvim'
|
[ -x "$(command -v nvim 2> /dev/null)" ] && alias vim='nvim'
|
||||||
[ -x "$(command -v neovide 2> /dev/null)" ] && alias nvim='neovide'
|
[ -x "$(command -v neovide 2> /dev/null)" ] && alias nvim='WINIT_X11_SCALE_FACTOR=1.0 neovide'
|
||||||
|
|
||||||
# Haskell
|
# ghcup (Haskell)
|
||||||
[ -f "$HOME/.ghcup/env" ] && source "$HOME/.ghcup/env" # ghcup-env
|
[ -f "$HOME/.ghcup/env" ] && source "$HOME/.ghcup/env" # ghcup-env
|
||||||
|
|
||||||
# NodeJS
|
# NodeJS
|
||||||
export npm_config_prefix="$HOME/.local" # This is where global packages are installed
|
export npm_config_prefix="$HOME/.local"
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
|
||||||
# Nix
|
# Bun
|
||||||
export PATH="$HOME/.nix-profile/bin:$PATH"
|
export BUN_INSTALL="$HOME/.bun"
|
||||||
|
export PATH="$BUN_INSTALL/bin:$PATH"
|
||||||
|
|
||||||
# Rust
|
# Julia
|
||||||
export PATH="$HOME/.cargo/bin/:$PATH"
|
export PATH="$HOME/.juliaup/bin:$PATH"
|
||||||
|
|
|
@ -1,36 +1,34 @@
|
||||||
{
|
{
|
||||||
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
|
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
|
||||||
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
|
"LuaSnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" },
|
||||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||||
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
"cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" },
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
|
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
|
||||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||||
"diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" },
|
"diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "805610a9393fa231f2c2b49cb521bfa413fadb3d" },
|
"gitsigns.nvim": { "branch": "main", "commit": "0a2a93f687ec051292943a4d139366332ac93688" },
|
||||||
"haskell-tools.nvim": { "branch": "master", "commit": "35ac2d964b004d0d0e0cc9bab039b70be36ca0f7" },
|
"haskell-tools.nvim": { "branch": "master", "commit": "2faa2c879c82652f1df3974c185901cf93c6367c" },
|
||||||
"kanagawa.nvim": { "branch": "master", "commit": "860e4f80df71221d18bf2cd9ef1deb4d364274d2" },
|
"kanagawa.nvim": { "branch": "master", "commit": "c19b9023842697ec92caf72cd3599f7dd7be4456" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "d3974346b6cef2116c8e7b08423256a834cb7cbc" },
|
"lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
|
"lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "9ae570e206360e47d30b4c35a4550c165f4ea7b7" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "b9084b1f42f790d6230dc66dbcb6bcc35b148552" },
|
||||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "67210c0e775adec55de9826b038e8b62de554afc" },
|
"mason-nvim-dap.nvim": { "branch": "main", "commit": "3614a39aae98ccd34124b072939d6283853b3dd2" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
|
"mason.nvim": { "branch": "main", "commit": "9c9416817c9f4e6f333c749327a1ed5355cfab61" },
|
||||||
"neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" },
|
"neo-tree.nvim": { "branch": "v3.x", "commit": "2f2d08894bbc679d4d181604c16bb7079f646384" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "cd2cf0c124d3de577fb5449746568ee8e601afc8" },
|
"neodev.nvim": { "branch": "main", "commit": "3408a4daeca5ff8f41cb2c668b6d8fcc665f793a" },
|
||||||
"nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" },
|
"neogit": { "branch": "master", "commit": "ce0c369ccdba3f644a3b28f4c053421f435352c9" },
|
||||||
"nvim-dap": { "branch": "master", "commit": "615a1b2046e1eaf7995e0ba8e8a65f344201349d" },
|
"nui.nvim": { "branch": "main", "commit": "35da9ca1de0fc4dda96c2e214d93d363c145f418" },
|
||||||
"nvim-dap-ui": { "branch": "master", "commit": "5934302d63d1ede12c0b22b6f23518bb183fc972" },
|
"nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "a3d9395455f2b2e3b50a0b0f37b8b4c23683f44a" },
|
"nvim-dap": { "branch": "master", "commit": "9adbfdca13afbe646d09a8d7a86d5d031fb9c5a5" },
|
||||||
"nvim-nio": { "branch": "master", "commit": "8765cbc4d0c629c8158a5341e1b4305fd93c3a90" },
|
"nvim-dap-ui": { "branch": "master", "commit": "d845ebd798ad1cf30aa4abd4c4eff795cdcfdd4f" },
|
||||||
"nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" },
|
"nvim-lspconfig": { "branch": "master", "commit": "8917d2c830e04bf944a699b8c41f097621283828" },
|
||||||
"nvim-surround": { "branch": "main", "commit": "6d0dc3dbb557bcc6a024969da461df4ba803fc48" },
|
"nvim-notify": { "branch": "master", "commit": "80b67b265530632505193553d05127ae7fe09ddd" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "fa1515b015ab9894aa9866410b1c23e03d2be4af" },
|
"nvim-treesitter": { "branch": "master", "commit": "ce4adf11cfe36fc5b0e5bcdce0c7c6e8fbc9798a" },
|
||||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "dfa4178c0cadb44f687603d72ad0908474c28dd9" },
|
"nvim-web-devicons": { "branch": "master", "commit": "b427ac5f9dff494f839e81441fb3f04a58cbcfbc" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "5b9067899ee6a2538891573500e8fd6ff008440f" },
|
"plenary.nvim": { "branch": "master", "commit": "663246936325062427597964d81d30eaa42ab1e4" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" },
|
|
||||||
"rustaceanvim": { "branch": "master", "commit": "bc8c4b8f7606d5b7c067cd8369e25c1a7ff77bd0" },
|
"rustaceanvim": { "branch": "master", "commit": "bc8c4b8f7606d5b7c067cd8369e25c1a7ff77bd0" },
|
||||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
|
||||||
"telescope.nvim": { "branch": "0.1.x", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" },
|
"telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
|
||||||
"trouble.nvim": { "branch": "dev", "commit": "b4b9a11b3578d510963f6f681fecb4631ae992c3" },
|
|
||||||
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
|
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
|
||||||
}
|
}
|
|
@ -1,4 +1,3 @@
|
||||||
return {
|
return {
|
||||||
keymap = require 'config.helpers.keymap',
|
keymap = require 'config.helpers.keymap',
|
||||||
visual = require 'config.helpers.visual',
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
---@class VisualArea
|
|
||||||
---@field sr number Start row
|
|
||||||
---@field sc number Start col
|
|
||||||
---@field er number End row
|
|
||||||
---@field ec number End col
|
|
||||||
|
|
||||||
---Get current visual selection area
|
|
||||||
---@return VisualArea
|
|
||||||
return function()
|
|
||||||
local select = vim.fn.getpos 'v'
|
|
||||||
local cursor = vim.fn.getpos '.'
|
|
||||||
local sr, er = select[2], cursor[2]
|
|
||||||
local sc, ec = select[3], cursor[3]
|
|
||||||
|
|
||||||
if sc > ec then sc, ec = ec, sc end
|
|
||||||
if sr > er then sr, er = er, sr end
|
|
||||||
|
|
||||||
return { sr = sr, sc = sc, er = er, ec = ec }
|
|
||||||
end
|
|
|
@ -1,11 +1,11 @@
|
||||||
local indent = require 'config.keymaps.indent'
|
|
||||||
local map = require 'config.helpers.keymap'
|
local map = require 'config.helpers.keymap'
|
||||||
local n = map 'n'
|
local n = map 'n'
|
||||||
local v = map 'v'
|
|
||||||
local t = map 't'
|
local t = map 't'
|
||||||
local nv = map {'n', 'v'}
|
local nv = map {'n', 'v'}
|
||||||
|
|
||||||
|
|
||||||
|
n '<Leader>ex' ':Explore<CR>' 'Netrw: open'
|
||||||
|
n '<Leader>hl' ':nohl<CR>' 'Hide highlights'
|
||||||
|
|
||||||
n 'j' 'gj' 'Move: down by line'
|
n 'j' 'gj' 'Move: down by line'
|
||||||
n 'k' 'gk' 'Move: up by line'
|
n 'k' 'gk' 'Move: up by line'
|
||||||
|
@ -22,42 +22,26 @@ n '<C-k>' '<C-w>k' 'Window: move up'
|
||||||
n '<C-l>' '<C-w>l' 'Window: move right'
|
n '<C-l>' '<C-w>l' 'Window: move right'
|
||||||
|
|
||||||
|
|
||||||
-- Indentation
|
|
||||||
v '>' '>gv' 'Indent right'
|
|
||||||
v '<' '<gv' 'Indent left'
|
|
||||||
v '|' (indent.normalize) 'Indent normalize'
|
|
||||||
|
|
||||||
|
|
||||||
-- Diagnostics
|
-- Diagnostics
|
||||||
n '<leader>e' (vim.diagnostic.open_float) 'Open error diagnostics'
|
|
||||||
n '[d' (vim.diagnostic.goto_prev) 'Previous diagnostic message'
|
|
||||||
n ']d' (vim.diagnostic.goto_next) 'Next diagnostic message'
|
|
||||||
n '<leader>dl' (vim.diagnostic.setloclist) 'Diagnostic: list messages'
|
|
||||||
|
|
||||||
-- X
|
n '<leader>e' (vim.diagnostic.open_float) 'Open error diagnostics'
|
||||||
local function insert_date()
|
n '[d' (vim.diagnostic.goto_prev) 'Previous diagnostic message'
|
||||||
local row, col = unpack(vim.api.nvim_win_get_cursor(0))
|
n ']d' (vim.diagnostic.goto_next) 'Next diagnostic message'
|
||||||
local text = os.date '!%Y-%m-%dT%H:%M:%SZ' ---@cast text string
|
n '<leader>dl' (vim.diagnostic.setloclist) 'Diagnostic: list messages'
|
||||||
col = math.min(#vim.api.nvim_get_current_line(), col + 1)
|
|
||||||
vim.api.nvim_buf_set_text(0, row - 1, col, row - 1, col, { text })
|
|
||||||
end
|
|
||||||
|
|
||||||
n '<Leader>xd' (insert_date) 'Execute: full date'
|
|
||||||
v '<Leader>xs' ':sort<CR>' 'Execute: sort'
|
|
||||||
|
|
||||||
|
|
||||||
-- Meta
|
-- Meta
|
||||||
|
|
||||||
local function open_config()
|
local function open_config()
|
||||||
vim.fn.chdir '~/.config/nvim'
|
vim.fn.chdir '~/.config/nvim'
|
||||||
vim.cmd 'Explore'
|
vim.cmd [[:Explore]]
|
||||||
end
|
end
|
||||||
|
|
||||||
n '<leader>mn' (open_config) 'Meta: neovim config'
|
n '<leader>mn' (open_config) 'Meta: neovim config'
|
||||||
n '<leader>ml' ':Lazy<CR>' 'Meta: lazy'
|
|
||||||
n '<leader>mm' ':Mason<CR>' 'Meta: mason'
|
|
||||||
|
|
||||||
|
|
||||||
-- LSP
|
-- LSP
|
||||||
|
|
||||||
do
|
do
|
||||||
local group = vim.api.nvim_create_augroup('UserLspConfig', {})
|
local group = vim.api.nvim_create_augroup('UserLspConfig', {})
|
||||||
|
|
||||||
|
@ -69,16 +53,6 @@ do
|
||||||
vim.lsp.buf.format({ async = true })
|
vim.lsp.buf.format({ async = true })
|
||||||
end
|
end
|
||||||
|
|
||||||
local function format_selection()
|
|
||||||
vim.lsp.buf.format({
|
|
||||||
async = true,
|
|
||||||
range = {
|
|
||||||
["start"] = vim.api.nvim_buf_get_mark(0, "<"),
|
|
||||||
["end"] = vim.api.nvim_buf_get_mark(0, ">"),
|
|
||||||
}
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
local function workspaces_list()
|
local function workspaces_list()
|
||||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
end
|
end
|
||||||
|
@ -94,7 +68,6 @@ do
|
||||||
n '<leader>lr' (vim.lsp.buf.rename) {'LSP: rename identifier', buffer}
|
n '<leader>lr' (vim.lsp.buf.rename) {'LSP: rename identifier', buffer}
|
||||||
nv '<leader>la' (vim.lsp.buf.code_action) {'LSP: code actions', buffer}
|
nv '<leader>la' (vim.lsp.buf.code_action) {'LSP: code actions', buffer}
|
||||||
n '<leader>lf' (format) {'LSP: format file', buffer}
|
n '<leader>lf' (format) {'LSP: format file', buffer}
|
||||||
v '<leader>lf' (format_selection) {'LSP: format file', buffer}
|
|
||||||
n '<leader>wa' (vim.lsp.buf.add_workspace_folder) {'LSP: add workspace folder', buffer}
|
n '<leader>wa' (vim.lsp.buf.add_workspace_folder) {'LSP: add workspace folder', buffer}
|
||||||
n '<leader>wr' (vim.lsp.buf.remove_workspace_folder) {'LSP: remove workspace folder', buffer}
|
n '<leader>wr' (vim.lsp.buf.remove_workspace_folder) {'LSP: remove workspace folder', buffer}
|
||||||
n '<leader>wl' (workspaces_list) {'LSP: list workspace folders', buffer}
|
n '<leader>wl' (workspaces_list) {'LSP: list workspace folders', buffer}
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
local get_visual = require 'config.helpers.visual'
|
|
||||||
local M = {}
|
|
||||||
|
|
||||||
|
|
||||||
function M.normalize()
|
|
||||||
local c = vim.fn.getpos '.'
|
|
||||||
local s = get_visual()
|
|
||||||
|
|
||||||
local max = 0
|
|
||||||
for line = s.sr, s.er do
|
|
||||||
local indent = vim.fn.indent(line)
|
|
||||||
max = indent > max and indent or max
|
|
||||||
end
|
|
||||||
|
|
||||||
for line = s.sr, s.er do
|
|
||||||
local content = vim.fn.getline(line)
|
|
||||||
if content:len() > 0 then
|
|
||||||
local current = vim.fn.indent(line)
|
|
||||||
if current ~= max then
|
|
||||||
local new = string.rep(' ', max - current)
|
|
||||||
vim.fn.setline(line, new .. content)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.fn.setpos('.', c)
|
|
||||||
end
|
|
||||||
|
|
||||||
return M
|
|
|
@ -2,7 +2,6 @@ local options = {
|
||||||
scroll_animation_far_lines = 100,
|
scroll_animation_far_lines = 100,
|
||||||
scroll_animation_length = 0.05,
|
scroll_animation_length = 0.05,
|
||||||
cursor_animation_length = 0.05,
|
cursor_animation_length = 0.05,
|
||||||
scale_factor = 0.8,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for key, val in pairs(options) do
|
for key, val in pairs(options) do
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
local is, when = require 'config.compose' ()
|
local is, when = require 'config.compose' ()
|
||||||
local map = require 'config.helpers.keymap'
|
local map = require 'config.helpers.keymap'
|
||||||
local n = map 'n'
|
local n = map 'n'
|
||||||
local nv = map { 'n', 'v' }
|
|
||||||
|
|
||||||
|
|
||||||
---@type LazySpec
|
---@type LazySpec
|
||||||
|
@ -25,10 +24,18 @@ return {
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'nvim-tree/nvim-web-devicons',
|
'nvim-tree/nvim-web-devicons',
|
||||||
},
|
},
|
||||||
config = true,
|
config = function()
|
||||||
|
local lualine = require 'lualine'
|
||||||
|
|
||||||
|
lualine.setup {
|
||||||
|
tabline = {
|
||||||
|
lualine_a = { 'buffers' },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Fuzzy search
|
-- Telescope
|
||||||
{
|
{
|
||||||
'nvim-telescope/telescope.nvim',
|
'nvim-telescope/telescope.nvim',
|
||||||
enabled = is 'standalone',
|
enabled = is 'standalone',
|
||||||
|
@ -72,23 +79,8 @@ return {
|
||||||
{
|
{
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
build = ':TSUpdate',
|
build = ':TSUpdate',
|
||||||
dependencies = {
|
|
||||||
-- 'nvim-treesitter/nvim-treesitter-textobjects'
|
|
||||||
},
|
|
||||||
config = function()
|
config = function()
|
||||||
local configs = require 'nvim-treesitter.configs'
|
local configs = require 'nvim-treesitter.configs'
|
||||||
local parsers = require('nvim-treesitter.parsers').get_parser_configs()
|
|
||||||
|
|
||||||
-- parsers['rescript'] = {
|
|
||||||
-- install_info = {
|
|
||||||
-- url = 'https://github.com/rescript-lang/tree-sitter-rescript',
|
|
||||||
-- branch = 'main',
|
|
||||||
-- files = { 'src/parser.c', 'src/scanner.c' },
|
|
||||||
-- generate_requires_npm = false,
|
|
||||||
-- requires_generate_from_grammar = true,
|
|
||||||
-- use_makefile = true,
|
|
||||||
-- },
|
|
||||||
-- }
|
|
||||||
|
|
||||||
configs.setup {
|
configs.setup {
|
||||||
modules = {},
|
modules = {},
|
||||||
|
@ -97,7 +89,7 @@ return {
|
||||||
ignore_install = {},
|
ignore_install = {},
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
-- neovim
|
-- neovim
|
||||||
'vimdoc', 'lua', 'query',
|
'vimdoc', 'lua', 'query', 'luadoc',
|
||||||
-- data
|
-- data
|
||||||
'json', 'xml', 'yaml', 'toml',
|
'json', 'xml', 'yaml', 'toml',
|
||||||
-- markdown
|
-- markdown
|
||||||
|
@ -112,8 +104,8 @@ return {
|
||||||
'bash',
|
'bash',
|
||||||
-- python
|
-- python
|
||||||
'python',
|
'python',
|
||||||
-- systems
|
-- rust
|
||||||
'rust', 'c',
|
'rust',
|
||||||
-- webdev
|
-- webdev
|
||||||
'html', 'css', 'scss', 'javascript', 'jsdoc', 'typescript', 'tsx', 'astro', 'svelte',
|
'html', 'css', 'scss', 'javascript', 'jsdoc', 'typescript', 'tsx', 'astro', 'svelte',
|
||||||
-- haskell
|
-- haskell
|
||||||
|
@ -124,30 +116,12 @@ return {
|
||||||
incremental_selection = {
|
incremental_selection = {
|
||||||
enable = true,
|
enable = true,
|
||||||
keymaps = {
|
keymaps = {
|
||||||
node_incremental = 'v',
|
init_selection = '<CR>',
|
||||||
node_decremental = 'V',
|
scope_incremental = '<CR>',
|
||||||
|
node_incremental = '<TAB>',
|
||||||
|
node_decremental = '<S-TAB>',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
textobjects = {
|
|
||||||
select = {
|
|
||||||
enable = true,
|
|
||||||
keymaps = {
|
|
||||||
['af'] = '@function.outer',
|
|
||||||
['if'] = '@function.inner',
|
|
||||||
['a?'] = '@conditional.outer',
|
|
||||||
['i?'] = '@conditional.inner',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
move = {
|
|
||||||
enable = true,
|
|
||||||
goto_next_start = {
|
|
||||||
[']f'] = '@function.outer',
|
|
||||||
},
|
|
||||||
goto_previous_start = {
|
|
||||||
['[f'] = '@function.outer',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
init = function()
|
init = function()
|
||||||
|
@ -158,50 +132,6 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Keymap hints
|
|
||||||
{
|
|
||||||
'folke/which-key.nvim',
|
|
||||||
enabled = is 'standalone',
|
|
||||||
init = function()
|
|
||||||
vim.o.timeout = true
|
|
||||||
vim.o.timeoutlen = 300
|
|
||||||
end,
|
|
||||||
config = true
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Notifications
|
|
||||||
{
|
|
||||||
'rcarriga/nvim-notify',
|
|
||||||
enabled = is 'standalone',
|
|
||||||
config = function()
|
|
||||||
vim.notify = require 'notify'
|
|
||||||
end
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Project errors
|
|
||||||
{
|
|
||||||
"folke/trouble.nvim",
|
|
||||||
branch = "dev",
|
|
||||||
config = function ()
|
|
||||||
local trouble = require 'trouble'
|
|
||||||
|
|
||||||
n '<leader>tt' '<cmd>Trouble diagnostics toggle<cr>' 'Trouble: Diagnostics'
|
|
||||||
n '<leader>tT' '<cmd>Trouble diagnostics toggle filter.buf=0<cr>' 'Trouble: Diagnostics (buffer)'
|
|
||||||
n '<leader>ts' '<cmd>Trouble symbols toggle focus=false<cr>' 'Trouble: Symbols'
|
|
||||||
-- n '<leader>cl' '<cmd>Trouble lsp toggle focus=false win.position=right<cr>' 'LSP Definitions / references / ... (Trouble)'
|
|
||||||
-- n '<leader>xL' '<cmd>Trouble loclist toggle<cr>' 'Location List (Trouble)'
|
|
||||||
-- n '<leader>xQ' '<cmd>Trouble qflist toggle<cr>' 'Quickfix List (Trouble)'
|
|
||||||
|
|
||||||
trouble.setup {}
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Comments
|
|
||||||
{
|
|
||||||
'numToStr/Comment.nvim',
|
|
||||||
config = true,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Git - file hunks
|
-- Git - file hunks
|
||||||
{
|
{
|
||||||
'lewis6991/gitsigns.nvim',
|
'lewis6991/gitsigns.nvim',
|
||||||
|
@ -232,44 +162,74 @@ return {
|
||||||
'nvim-tree/nvim-web-devicons',
|
'nvim-tree/nvim-web-devicons',
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local lib = require 'diffview.lib'
|
n '<Leader>gd' ':DiffviewOpen<CR>' 'Git: Diff'
|
||||||
|
n '<Leader>gc' ':DiffviewClose<CR>' 'Git: Close'
|
||||||
local function toggle(name)
|
n '<Leader>gh' ':DiffviewFileHistory<CR>' 'Git: History'
|
||||||
return function()
|
|
||||||
if not next(lib.views) then
|
|
||||||
vim.cmd(name)
|
|
||||||
else
|
|
||||||
vim.cmd 'DiffviewClose'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
n '<Leader>gd' (toggle 'DiffviewOpen') 'Git: Diff'
|
|
||||||
n '<Leader>gh' (toggle 'DiffviewFileHistory') 'Git: History'
|
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Color hints
|
-- Git: ops
|
||||||
{
|
{
|
||||||
'NvChad/nvim-colorizer.lua',
|
'NeogitOrg/neogit',
|
||||||
ft = { 'css', 'scss' },
|
enabled = is 'standalone',
|
||||||
|
dependencies = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
'sindrets/diffview.nvim',
|
||||||
|
'nvim-telescope/telescope.nvim'
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local neogit = require 'neogit'
|
||||||
|
|
||||||
|
neogit.setup {
|
||||||
|
graph_style = 'unicode',
|
||||||
|
integrations = {
|
||||||
|
telescope = true,
|
||||||
|
diffview = true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
n '<Leader>gn' (neogit.open) 'Git: Neogit'
|
||||||
|
end
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Comments
|
||||||
|
{
|
||||||
|
'numToStr/Comment.nvim',
|
||||||
config = true,
|
config = true,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- {
|
-- Shortcut hints
|
||||||
-- dir = '~/Desktop/disasm.nvim',
|
{
|
||||||
-- ft = { 'c' },
|
'folke/which-key.nvim',
|
||||||
-- config = function()
|
enabled = is 'standalone',
|
||||||
-- local disasm = require 'disasm'
|
event = 'VeryLazy',
|
||||||
--
|
init = function()
|
||||||
-- n '<Leader>a' (disasm.disassemble) 'Disasm: Disassemble'
|
vim.o.timeout = true
|
||||||
-- n '<Leader>Af' (disasm.disassemble_full) 'Disasm: Disassemble full'
|
vim.o.timeoutlen = 300
|
||||||
-- n '<Leader>Ac' (disasm.reconfigure) 'Disasm: Configure'
|
end,
|
||||||
-- n '<Leader>AC' (disasm.save_config) 'Disasm: Save config'
|
opts = {}
|
||||||
--
|
},
|
||||||
-- disasm.setup()
|
|
||||||
-- end
|
-- Notifications
|
||||||
-- },
|
{
|
||||||
|
'rcarriga/nvim-notify',
|
||||||
|
enabled = is 'standalone',
|
||||||
|
config = function()
|
||||||
|
vim.notify = require 'notify'
|
||||||
|
end
|
||||||
|
},
|
||||||
|
|
||||||
|
-- File tree
|
||||||
|
{
|
||||||
|
'nvim-neo-tree/neo-tree.nvim',
|
||||||
|
enabled = is 'standalone',
|
||||||
|
branch = 'v3.x',
|
||||||
|
dependencies = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
'nvim-tree/nvim-web-devicons',
|
||||||
|
'MunifTanjim/nui.nvim',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
-- Snippet engine
|
-- Snippet engine
|
||||||
{
|
{
|
||||||
|
@ -300,40 +260,23 @@ return {
|
||||||
{
|
{
|
||||||
'mfussenegger/nvim-dap',
|
'mfussenegger/nvim-dap',
|
||||||
enabled = is { 'standalone', 'linux' },
|
enabled = is { 'standalone', 'linux' },
|
||||||
dependencies = {
|
|
||||||
'nvim-neotest/nvim-nio',
|
|
||||||
'rcarriga/nvim-dap-ui',
|
|
||||||
},
|
|
||||||
config = function()
|
config = function()
|
||||||
local dap = require 'dap'
|
local dap = require 'dap'
|
||||||
local ui = require 'dapui'
|
|
||||||
|
|
||||||
n '<F5>' (dap.continue) 'Debugger: continue'
|
n '<leader>b' (dap.toggle_breakpoint) 'DAP: Toggle breakpoint'
|
||||||
n '<F10>' (dap.step_over) 'Debugger: step over'
|
|
||||||
n '<F11>' (dap.step_into) 'Debugger: step into'
|
|
||||||
n '<F12>' (dap.step_out) 'Debugger: step out'
|
|
||||||
n '<leader>db' (dap.toggle_breakpoint) 'Debugger: toggle breakpoint'
|
|
||||||
|
|
||||||
n '<leader>du' (ui.toggle) 'Debugger: toggle UI'
|
|
||||||
nv '<leader>de' (ui.eval) 'Debugger: eval'
|
|
||||||
|
|
||||||
-- vim.api.nvim_set_hl(0, 'DapBreakpoint', { ctermbg = 0, fg = '#993939', bg = '#31353f' })
|
|
||||||
-- vim.api.nvim_set_hl(0, 'DapLogPoint', { ctermbg = 0, fg = '#61afef', bg = '#31353f' })
|
|
||||||
-- vim.api.nvim_set_hl(0, 'DapStopped', { ctermbg = 0, fg = '#98c379', bg = '#31353f' })
|
|
||||||
--
|
|
||||||
-- vim.fn.sign_define('DapBreakpoint', { text='', texthl='DapBreakpoint', linehl='DapBreakpoint', numhl='DapBreakpoint' })
|
|
||||||
-- vim.fn.sign_define('DapBreakpointCondition', { text='ﳁ', texthl='DapBreakpoint', linehl='DapBreakpoint', numhl='DapBreakpoint' })
|
|
||||||
-- vim.fn.sign_define('DapBreakpointRejected', { text='', texthl='DapBreakpoint', linehl='DapBreakpoint', numhl= 'DapBreakpoint' })
|
|
||||||
-- vim.fn.sign_define('DapLogPoint', { text='', texthl='DapLogPoint', linehl='DapLogPoint', numhl= 'DapLogPoint' })
|
|
||||||
-- vim.fn.sign_define('DapStopped', { text='', texthl='DapStopped', linehl='DapStopped', numhl= 'DapStopped' })
|
|
||||||
|
|
||||||
ui.setup()
|
|
||||||
dap.listeners.after.event_initialized["dapui_config"] = ui.open
|
|
||||||
dap.listeners.after.event_terminated["dapui_config"] = ui.close
|
|
||||||
dap.listeners.before.event_exited["dapui_config"] = ui.close
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Debugger UI
|
||||||
|
{
|
||||||
|
'rcarriga/nvim-dap-ui',
|
||||||
|
enabled = is { 'standalone', 'linux' },
|
||||||
|
dependencies = {
|
||||||
|
'mfussenegger/nvim-dap',
|
||||||
|
},
|
||||||
|
config = require 'config.plugins.nvim-dap-ui'
|
||||||
|
},
|
||||||
|
|
||||||
-- Mason
|
-- Mason
|
||||||
{
|
{
|
||||||
'williamboman/mason.nvim',
|
'williamboman/mason.nvim',
|
||||||
|
@ -358,22 +301,22 @@ return {
|
||||||
|
|
||||||
config.setup {
|
config.setup {
|
||||||
automatic_installation = true,
|
automatic_installation = true,
|
||||||
-- NOTE: Haskell is managed via GHCup
|
-- NOTE
|
||||||
|
-- Haskell: Managed by GHCup
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
'lua_ls', -- Lua
|
'lua_ls', -- Lua
|
||||||
'rust_analyzer', -- Rust
|
'rust_analyzer', -- Rust
|
||||||
-- 'clangd', -- C
|
'bashls', -- Bash
|
||||||
-- 'bashls', -- Bash
|
|
||||||
'html', -- HTML
|
'html', -- HTML
|
||||||
'cssls', -- CSS / SCSS
|
'cssls', -- CSS / SCSS
|
||||||
'tsserver', -- TypeScript
|
'tsserver', -- TypeScript
|
||||||
-- 'astro', -- Astro
|
'astro', -- Astro
|
||||||
-- 'svelte', -- Svelte
|
'svelte', -- Svelte
|
||||||
-- 'pyright', -- Python
|
'pyright', -- Python
|
||||||
-- 'rnix', -- Nix
|
'rnix', -- Nix
|
||||||
-- 'purescriptls', -- Purescript
|
'purescriptls', -- Purescript
|
||||||
'ltex', -- Literate - LaTeX, Markdown, etc.
|
'ltex', -- Literate - LaTeX, Markdown, etc.
|
||||||
'rescriptls', -- ReScript
|
'julials', -- Julia
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -386,18 +329,6 @@ return {
|
||||||
end,
|
end,
|
||||||
['rust_analyzer'] = noop,
|
['rust_analyzer'] = noop,
|
||||||
}
|
}
|
||||||
|
|
||||||
local signs = {
|
|
||||||
Error = "",
|
|
||||||
Warn = "",
|
|
||||||
Hint = "",
|
|
||||||
Info = "",
|
|
||||||
}
|
|
||||||
|
|
||||||
for sign, text in pairs(signs) do
|
|
||||||
local name = 'DiagnosticSign' .. sign
|
|
||||||
vim.fn.sign_define(name, { text = text, texthl = name })
|
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -416,7 +347,6 @@ return {
|
||||||
automatic_installation = true,
|
automatic_installation = true,
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
'codelldb',
|
'codelldb',
|
||||||
--'js-debug-adapter',
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
@ -467,50 +397,4 @@ return {
|
||||||
init = require 'config.plugins.haskell-tools'
|
init = require 'config.plugins.haskell-tools'
|
||||||
},
|
},
|
||||||
|
|
||||||
-- JS debugger
|
|
||||||
-- {
|
|
||||||
-- 'mxsdev/nvim-dap-vscode-js',
|
|
||||||
-- dependencies = {
|
|
||||||
-- 'microsoft/vscode-js-debug',
|
|
||||||
-- version = '1.x',
|
|
||||||
-- build = 'npm i && npm run compile vsDebugServerBundle && mv dist out',
|
|
||||||
-- },
|
|
||||||
-- config = function()
|
|
||||||
-- local dap = require 'dap'
|
|
||||||
-- --local utils = require 'dap.utils'
|
|
||||||
-- local dap_js = require 'dap-vscode-js'
|
|
||||||
-- --local mason = require 'mason-registry'
|
|
||||||
--
|
|
||||||
-- ---@diagnostic disable-next-line: missing-fields
|
|
||||||
-- dap_js.setup {
|
|
||||||
-- -- debugger_path = mason.get_package('js-debug-adapter'):get_install_path(),
|
|
||||||
-- debugger_path = vim.fn.stdpath 'data' .. '/lazy/vscode-js-debug',
|
|
||||||
-- adapters = { 'pwa-node', 'pwa-chrome', 'pwa-msedge', 'node-terminal', 'pwa-extensionHost' },
|
|
||||||
-- }
|
|
||||||
--
|
|
||||||
-- local langs = { 'javascript', 'typescript', 'svelte', 'astro' }
|
|
||||||
-- for _, lang in ipairs(langs) do
|
|
||||||
-- dap.configurations[lang] = {
|
|
||||||
-- {
|
|
||||||
-- type = 'pwa-node',
|
|
||||||
-- request = 'attach',
|
|
||||||
-- name = 'Attach debugger to existing `node --inspect` process',
|
|
||||||
-- cwd = '${workspaceFolder}',
|
|
||||||
-- skipFiles = {
|
|
||||||
-- '${workspaceFolder}/node_modules/**/*.js',
|
|
||||||
-- '${workspaceFolder}/packages/**/node_modules/**/*.js',
|
|
||||||
-- '${workspaceFolder}/packages/**/**/node_modules/**/*.js',
|
|
||||||
-- '<node_internals>/**',
|
|
||||||
-- 'node_modules/**',
|
|
||||||
-- },
|
|
||||||
-- sourceMaps = true,
|
|
||||||
-- resolveSourceMapLocations = {
|
|
||||||
-- '${workspaceFolder}/**',
|
|
||||||
-- '!**/node_modules/**',
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- }
|
|
||||||
-- end
|
|
||||||
-- end,
|
|
||||||
-- },
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,11 +23,10 @@ local function on_attach(_, buffer, ht)
|
||||||
-- ht.dap.discover_configurations(bufnr)
|
-- ht.dap.discover_configurations(bufnr)
|
||||||
end
|
end
|
||||||
|
|
||||||
---@type HTConfig
|
|
||||||
local config = {
|
|
||||||
hls = { on_attach = on_attach }
|
|
||||||
}
|
|
||||||
|
|
||||||
return function()
|
return function()
|
||||||
vim.g.haskell_tools = config
|
vim.g.haskell_tools = {
|
||||||
|
---@type HaskellLspClientOpts`
|
||||||
|
hls = { on_attach = on_attach }
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
87
nvim/lua/config/plugins/nvim-dap-ui.lua
Normal file
87
nvim/lua/config/plugins/nvim-dap-ui.lua
Normal file
|
@ -0,0 +1,87 @@
|
||||||
|
return function()
|
||||||
|
local dap = require "dap"
|
||||||
|
local dapui = require "dapui"
|
||||||
|
|
||||||
|
dapui.setup({
|
||||||
|
icons = { expanded = "▾", collapsed = "▸", current_frame = "▸" },
|
||||||
|
mappings = {
|
||||||
|
-- Use a table to apply multiple mappings
|
||||||
|
expand = { "<CR>", "<2-LeftMouse>" },
|
||||||
|
open = "o",
|
||||||
|
remove = "d",
|
||||||
|
edit = "e",
|
||||||
|
repl = "r",
|
||||||
|
toggle = "t",
|
||||||
|
},
|
||||||
|
-- Expand lines larger than the window
|
||||||
|
-- Requires >= 0.7
|
||||||
|
expand_lines = vim.fn.has("nvim-0.7") == 1,
|
||||||
|
-- Layouts define sections of the screen to place windows.
|
||||||
|
-- The position can be "left", "right", "top" or "bottom".
|
||||||
|
-- The size specifies the height/width depending on position. It can be an Int
|
||||||
|
-- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while
|
||||||
|
-- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns)
|
||||||
|
-- Elements are the elements shown in the layout (in order).
|
||||||
|
-- Layouts are opened in order so that earlier layouts take priority in window sizing.
|
||||||
|
layouts = {
|
||||||
|
{
|
||||||
|
elements = {
|
||||||
|
-- Elements can be strings or table with id and size keys.
|
||||||
|
"breakpoints",
|
||||||
|
"stacks",
|
||||||
|
"watches",
|
||||||
|
{ id = "scopes", size = 0.25 },
|
||||||
|
},
|
||||||
|
size = 40, -- 40 columns
|
||||||
|
position = "left",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
elements = {
|
||||||
|
"repl",
|
||||||
|
"console",
|
||||||
|
},
|
||||||
|
size = 0.25, -- 25% of total lines
|
||||||
|
position = "bottom",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
controls = {
|
||||||
|
-- Requires Neovim nightly (or 0.8 when released)
|
||||||
|
enabled = true,
|
||||||
|
-- Display controls in this element
|
||||||
|
element = "repl",
|
||||||
|
icons = {
|
||||||
|
pause = "",
|
||||||
|
play = "",
|
||||||
|
step_into = "",
|
||||||
|
step_over = "",
|
||||||
|
step_out = "",
|
||||||
|
step_back = "",
|
||||||
|
run_last = "↻",
|
||||||
|
terminate = "□",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
floating = {
|
||||||
|
max_height = nil, -- These can be integers or a float between 0 and 1.
|
||||||
|
max_width = nil, -- Floats will be treated as percentage of your screen.
|
||||||
|
border = "single", -- Border style. Can be "single", "double" or "rounded"
|
||||||
|
mappings = {
|
||||||
|
close = { "q", "<Esc>" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
windows = { indent = 1 },
|
||||||
|
render = {
|
||||||
|
max_type_length = nil, -- Can be integer or nil.
|
||||||
|
max_value_lines = 100, -- Can be integer or nil.
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||||
|
dapui.open()
|
||||||
|
end
|
||||||
|
-- dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||||
|
-- dapui.close()
|
||||||
|
-- end
|
||||||
|
-- dap.listeners.before.event_exited["dapui_config"] = function()
|
||||||
|
-- dapui.close()
|
||||||
|
-- end
|
||||||
|
end
|
|
@ -19,17 +19,6 @@ vim.g.rustaceanvim = function()
|
||||||
n '<Leader>a' (tools.code_action_group.code_action_group) {buffer=bufnr}
|
n '<Leader>a' (tools.code_action_group.code_action_group) {buffer=bufnr}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
default_settings = {
|
|
||||||
['rust-analyzer'] = {
|
|
||||||
-- checkOnSave = {
|
|
||||||
-- allFeatures = true,
|
|
||||||
-- overrideCommand = {
|
|
||||||
-- 'cargo', 'clippy', '--workspace', '--message-format=json',
|
|
||||||
-- '--all-targets', '--all-features'
|
|
||||||
-- }
|
|
||||||
-- },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
dap = {
|
dap = {
|
||||||
adapter = config.get_codelldb_adapter(lsp_path, lib_path),
|
adapter = config.get_codelldb_adapter(lsp_path, lib_path),
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue