mirror of
https://github.com/iofq/nvim.nix.git
synced 2026-01-23 08:55:16 -06:00
few bugfixes, mini.files
This commit is contained in:
parent
4ceceff9bf
commit
14fec02d63
9 changed files with 149 additions and 162 deletions
|
|
@ -105,22 +105,26 @@ with lib;
|
|||
# and prepends the nvim and after directory to the RTP
|
||||
initLua = ''
|
||||
vim.opt.rtp:prepend('${nvimRtp}/lua')
|
||||
lazy_opts = {
|
||||
LAZY_OPTS = {
|
||||
performance = {
|
||||
reset_packpath = false,
|
||||
rtp = { reset = false, },
|
||||
rtp = {
|
||||
reset = false,
|
||||
disabled_plugins = {
|
||||
"netrwPlugin",
|
||||
"tutor",
|
||||
},
|
||||
},
|
||||
},
|
||||
dev = {
|
||||
path = "${pkgs.neovimUtils.packDir neovimConfig.packpathDirs}/pack/myNeovimPackages/start",
|
||||
patterns = {""},
|
||||
},
|
||||
checker = {
|
||||
enabled = false,
|
||||
},
|
||||
install = { missing = false, },
|
||||
spec = {{ import = "plugins" }},
|
||||
disabled_plugins = {
|
||||
"netrwPlugin",
|
||||
"tutor",
|
||||
"zipPlugin",
|
||||
},
|
||||
}
|
||||
'' + (builtins.readFile ../nvim/init.lua);
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ with final.pkgs.lib; let
|
|||
nvim-lspconfig
|
||||
nvim-neoclip-lua
|
||||
nvim-nio
|
||||
nvim-autopairs
|
||||
nvim-treesitter-context
|
||||
nvim-treesitter-textobjects
|
||||
(nvim-treesitter.withPlugins(p: with p; [
|
||||
|
|
@ -72,8 +73,6 @@ with final.pkgs.lib; let
|
|||
tree-sitter-typescript
|
||||
tree-sitter-yaml
|
||||
]))
|
||||
nvim-web-devicons
|
||||
oil-nvim
|
||||
outline-nvim
|
||||
scope-nvim
|
||||
snipe-nvim
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
vim.g.mapleader = ' '
|
||||
-- If lazy_opts is set, we're running in wrapped neovim via nix
|
||||
if not lazy_opts then
|
||||
if not LAZY_OPTS then
|
||||
-- Bootstrapping lazy.nvim
|
||||
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
|
|
@ -14,14 +14,19 @@ if not lazy_opts then
|
|||
}
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
lazy_opts = {
|
||||
LAZY_OPTS = {
|
||||
spec = { { import = 'plugins' } },
|
||||
disabled_plugins = {
|
||||
'netrwPlugin',
|
||||
'tutor',
|
||||
'zipPlugin',
|
||||
performance = {
|
||||
reset_packpath = false,
|
||||
rtp = {
|
||||
reset = false,
|
||||
disabled_plugins = {
|
||||
"netrwPlugin",
|
||||
"tutor",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
require('lazy').setup(lazy_opts)
|
||||
require('lazy').setup(LAZY_OPTS)
|
||||
require('config')
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ vim.opt.relativenumber = true
|
|||
vim.opt.shadafile = 'NONE' -- disable shada
|
||||
vim.opt.shiftwidth = 0 -- >> shifts by tabstop
|
||||
vim.opt.showmatch = true -- highlight matching brackets
|
||||
vim.opt.showmode = true
|
||||
vim.opt.showmode = false
|
||||
vim.opt.signcolumn = 'no'
|
||||
vim.opt.spell = false
|
||||
vim.opt.softtabstop = -1 -- backspace removes tabstop
|
||||
|
|
@ -84,7 +84,10 @@ vim.diagnostic.config {
|
|||
|
||||
-- random keymaps
|
||||
vim.keymap.set('n', 'gq', vim.cmd.bdelete, { silent = true })
|
||||
vim.keymap.set('n', 'gr', 'gT', { noremap = true, silent = true })
|
||||
vim.keymap.set('n', 'gt', vim.cmd.bnext, { silent = true })
|
||||
vim.keymap.set('n', 'gr', vim.cmd.bprev, { silent = true })
|
||||
vim.keymap.set('n', 'tr', 'gT', { noremap = true, silent = true })
|
||||
vim.keymap.set('n', 'tt', 'gt', { noremap = true, silent = true })
|
||||
vim.keymap.set('n', 'n', 'nzz', { noremap = true, silent = true })
|
||||
vim.keymap.set('n', 'N', 'Nzz', { noremap = true, silent = true })
|
||||
vim.keymap.set({ 'v', 'i' }, 'wq', '<esc>l', { noremap = true, silent = true })
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ return {
|
|||
},
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
event = 'VeryLazy',
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
},
|
||||
|
|
@ -39,7 +39,7 @@ return {
|
|||
lspconfig.util.default_config.capabilities,
|
||||
require('cmp_nvim_lsp').default_capabilities()
|
||||
)
|
||||
|
||||
vim.lsp.inlay_hint.enable(true)
|
||||
lspconfig.gopls.setup {
|
||||
settings = {
|
||||
gopls = {
|
||||
|
|
@ -91,15 +91,12 @@ return {
|
|||
Lua = {},
|
||||
},
|
||||
}
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Prev diagnostic' })
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Next diagnostic' })
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
|
||||
callback = function(ev)
|
||||
local bufnr = ev.buf
|
||||
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
||||
require('workspace-diagnostics').populate_workspace_diagnostics(client, bufnr)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'K',
|
||||
|
|
@ -175,6 +172,7 @@ return {
|
|||
})
|
||||
vim.lsp.codelens.refresh { bufnr = bufnr }
|
||||
end
|
||||
require('workspace-diagnostics').populate_workspace_diagnostics(client, bufnr)
|
||||
end,
|
||||
})
|
||||
vim.api.nvim_exec_autocmds('FileType', {})
|
||||
|
|
|
|||
|
|
@ -3,9 +3,10 @@ return {
|
|||
'echasnovski/mini.nvim',
|
||||
lazy = false,
|
||||
config = function()
|
||||
require('mini.ai').setup()
|
||||
require('mini.comment').setup()
|
||||
require('mini.pairs').setup()
|
||||
require('mini.tabline').setup({
|
||||
tabpage_section = 'right',
|
||||
show_icons = false,
|
||||
})
|
||||
require('mini.statusline').setup {
|
||||
content = {
|
||||
active = function()
|
||||
|
|
@ -50,103 +51,103 @@ return {
|
|||
end,
|
||||
},
|
||||
}
|
||||
vim.opt.showmode = false
|
||||
vim.schedule(function()
|
||||
require('mini.ai').setup()
|
||||
require('mini.align').setup()
|
||||
require('mini.bracketed').setup()
|
||||
require('mini.comment').setup()
|
||||
require('mini.icons').setup()
|
||||
require('mini.surround').setup()
|
||||
require('mini.jump2d').setup { mappings = { start_jumping = '<leader>S' } }
|
||||
require('mini.splitjoin').setup { detect = { separator = '[,;\n]' }, }
|
||||
require('mini.basics').setup { mappings = { windows = true, }, }
|
||||
require('mini.trailspace').setup()
|
||||
vim.api.nvim_create_user_command('Trim', function()
|
||||
require('mini.trailspace').trim()
|
||||
end, {})
|
||||
local indent = require('mini.indentscope')
|
||||
indent.setup {
|
||||
draw = { delay = 0 },
|
||||
}
|
||||
indent.gen_animation.none()
|
||||
|
||||
local miniclue = require('mini.clue')
|
||||
miniclue.setup {
|
||||
triggers = {
|
||||
{ mode = 'n', keys = '<Leader>' },
|
||||
{ mode = 'n', keys = 'g' },
|
||||
{ mode = 'n', keys = "'" },
|
||||
{ mode = 'n', keys = '`' },
|
||||
{ mode = 'n', keys = '"' },
|
||||
{ mode = 'n', keys = '<C-w>' },
|
||||
{ mode = 'n', keys = 'z' },
|
||||
},
|
||||
|
||||
clues = {
|
||||
miniclue.gen_clues.g(),
|
||||
miniclue.gen_clues.marks(),
|
||||
miniclue.gen_clues.registers(),
|
||||
miniclue.gen_clues.windows(),
|
||||
miniclue.gen_clues.z(),
|
||||
},
|
||||
}
|
||||
-- Add surrounding with sa
|
||||
-- Delete surrounding with sd.
|
||||
-- Replace surrounding with sr.
|
||||
-- Find surrounding with sf or sF (move cursor right or left).
|
||||
-- Highlight surrounding with sh<char>.
|
||||
-- 'f' - function call (string of alphanumeric symbols or '_' or '.' followed by balanced '()'). In "input" finds function call, in "output" prompts user to enter function name.
|
||||
-- 't' - tag. In "input" finds tag with same identifier, in "output" prompts user to enter tag name.
|
||||
-- All symbols in brackets '()', '[]', '{}', '<>".
|
||||
-- '?' - interactive. Prompts user to enter left and right parts.
|
||||
require('mini.surround').setup()
|
||||
|
||||
require('mini.trailspace').setup()
|
||||
vim.api.nvim_create_user_command('Trim', function()
|
||||
require('mini.trailspace').trim()
|
||||
end, {})
|
||||
|
||||
-- prefix \
|
||||
-- `b` - |'background'|.
|
||||
-- `c` - |'cursorline'|.
|
||||
-- `C` - |'cursorcolumn'|.
|
||||
-- `d` - diagnostic (via |vim.diagnostic.enable()| and |vim.diagnostic.disable()|).
|
||||
-- `h` - |'hlsearch'| (or |v:hlsearch| to be precise).
|
||||
-- `i` - |'ignorecase'|.
|
||||
-- `l` - |'list'|.
|
||||
-- `n` - |'number'|.
|
||||
-- `r` - |'relativenumber'|.
|
||||
-- `s` - |'spell'|.
|
||||
-- `w` - |'wrap'|.
|
||||
require('mini.basics').setup {
|
||||
mappings = {
|
||||
windows = true,
|
||||
},
|
||||
}
|
||||
|
||||
local map = require('mini.map')
|
||||
map.setup {
|
||||
symbols = {
|
||||
scroll_line = '┃',
|
||||
scroll_view = '',
|
||||
},
|
||||
integrations = {
|
||||
map.gen_integration.builtin_search(),
|
||||
map.gen_integration.diagnostic(),
|
||||
map.gen_integration.gitsigns(),
|
||||
},
|
||||
window = {
|
||||
show_integration_count = false,
|
||||
winblend = 0,
|
||||
width = 5,
|
||||
},
|
||||
}
|
||||
vim.keymap.set('n', '<leader>nm', map.toggle, { noremap = true, desc = 'minimap open' })
|
||||
|
||||
-- gS
|
||||
require('mini.splitjoin').setup {
|
||||
detect = { separator = '[,;\n]' },
|
||||
}
|
||||
require('mini.jump2d').setup { mappings = { start_jumping = '<leader>S' } }
|
||||
|
||||
local indent = require('mini.indentscope')
|
||||
indent.setup {
|
||||
draw = { delay = 0 },
|
||||
}
|
||||
indent.gen_animation.none()
|
||||
|
||||
require('mini.notify').setup {
|
||||
window = {
|
||||
winblend = 0,
|
||||
config = {
|
||||
anchor = 'SE',
|
||||
border = 'double',
|
||||
row = vim.o.lines,
|
||||
local miniclue = require('mini.clue')
|
||||
miniclue.setup {
|
||||
triggers = {
|
||||
{ mode = 'n', keys = '<Leader>' },
|
||||
{ mode = 'n', keys = 'g' },
|
||||
{ mode = 'n', keys = "'" },
|
||||
{ mode = 'n', keys = '`' },
|
||||
{ mode = 'n', keys = '"' },
|
||||
{ mode = 'n', keys = '<C-w>' },
|
||||
{ mode = 'n', keys = 'z' },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
clues = {
|
||||
miniclue.gen_clues.g(),
|
||||
miniclue.gen_clues.marks(),
|
||||
miniclue.gen_clues.registers(),
|
||||
miniclue.gen_clues.windows(),
|
||||
miniclue.gen_clues.z(),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
local map = require('mini.map')
|
||||
map.setup {
|
||||
symbols = {
|
||||
scroll_line = '┃',
|
||||
scroll_view = '',
|
||||
},
|
||||
integrations = {
|
||||
map.gen_integration.builtin_search(),
|
||||
map.gen_integration.diagnostic(),
|
||||
map.gen_integration.gitsigns(),
|
||||
},
|
||||
window = {
|
||||
show_integration_count = false,
|
||||
winblend = 0,
|
||||
width = 5,
|
||||
},
|
||||
}
|
||||
vim.keymap.set('n', '<leader>nm', map.toggle, { noremap = true, desc = 'minimap open' })
|
||||
|
||||
require('mini.notify').setup {
|
||||
window = {
|
||||
winblend = 0,
|
||||
config = {
|
||||
border = 'double',
|
||||
},
|
||||
},
|
||||
}
|
||||
local files = require("mini.files")
|
||||
files.setup {
|
||||
mappings = {
|
||||
synchronize = "w",
|
||||
go_in_plus="<CR>"
|
||||
},
|
||||
windows = {
|
||||
preview = true,
|
||||
width_preview = 50,
|
||||
}
|
||||
}
|
||||
vim.keymap.set('n', '<leader>c', files.open, { noremap = true, desc = 'minifiles open' })
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "MiniFilesBufferCreate",
|
||||
callback = function(args)
|
||||
local buf_id = args.data.buf_id
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>c",
|
||||
function()
|
||||
files.synchronize()
|
||||
files.close()
|
||||
end,
|
||||
{ buffer = buf_id }
|
||||
)
|
||||
end,
|
||||
})
|
||||
end)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
return {
|
||||
{
|
||||
'windwp/nvim-autopairs',
|
||||
event = "InsertEnter",
|
||||
config = true
|
||||
},
|
||||
{
|
||||
'danymat/neogen',
|
||||
event = 'VeryLazy',
|
||||
|
|
@ -27,7 +32,6 @@ return {
|
|||
event = 'VeryLazy',
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"nvim-tree/nvim-web-devicons"
|
||||
}
|
||||
},
|
||||
{ 'tiagovla/scope.nvim', event = 'VeryLazy', config = true },
|
||||
|
|
@ -59,9 +63,6 @@ return {
|
|||
'leath-dub/snipe.nvim',
|
||||
event = 'VeryLazy',
|
||||
opts = {
|
||||
ui = {
|
||||
position = 'center',
|
||||
},
|
||||
sort = 'last',
|
||||
},
|
||||
config = function(_, opts)
|
||||
|
|
@ -108,31 +109,6 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
'stevearc/oil.nvim',
|
||||
opts = {
|
||||
watch_for_changes = true,
|
||||
columns = {
|
||||
'permissions',
|
||||
'size',
|
||||
},
|
||||
view_options = {
|
||||
show_hidden = true,
|
||||
},
|
||||
keymaps = {
|
||||
['wq'] = 'actions.close',
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
'<leader>nc',
|
||||
function()
|
||||
require('oil').toggle_float()
|
||||
end,
|
||||
{ noremap = true, silent = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
'mbbill/undotree',
|
||||
event = 'VeryLazy',
|
||||
|
|
@ -157,16 +133,18 @@ return {
|
|||
config = function(_, opts)
|
||||
require('nightfox').setup(opts)
|
||||
vim.cmd('colorscheme terafox')
|
||||
vim.api.nvim_set_hl(0, 'MiniNotifyNormal', { bg = 'none' })
|
||||
vim.api.nvim_set_hl(0, 'MiniNotifyTitle', { bg = 'none' })
|
||||
vim.api.nvim_set_hl(0, 'MiniNotifyBorder', { bg = 'none' })
|
||||
vim.api.nvim_set_hl(0, 'MiniMapNormal', { bg = 'none' })
|
||||
vim.api.nvim_set_hl(0, 'MiniClueNormal', { bg = 'none' })
|
||||
vim.api.nvim_set_hl(0, 'StatusLine', { bg = 'none' })
|
||||
vim.api.nvim_set_hl(0, 'StatusLineNC', { bg = 'none' })
|
||||
vim.api.nvim_set_hl(0, 'GitSignsAdd', { fg = 'green', bold = true })
|
||||
vim.api.nvim_set_hl(0, 'GitSignsDelete', { fg = 'red', bold = true })
|
||||
vim.api.nvim_set_hl(0, 'GitSignsChange', { fg = 'green', bold = true })
|
||||
vim.schedule(function()
|
||||
vim.api.nvim_set_hl(0, 'MiniNotifyNormal', { bg = 'none' })
|
||||
vim.api.nvim_set_hl(0, 'MiniNotifyTitle', { bg = 'none' })
|
||||
vim.api.nvim_set_hl(0, 'MiniNotifyBorder', { bg = 'none' })
|
||||
vim.api.nvim_set_hl(0, 'MiniMapNormal', { bg = 'none' })
|
||||
vim.api.nvim_set_hl(0, 'MiniClueNormal', { bg = 'none' })
|
||||
vim.api.nvim_set_hl(0, 'StatusLine', { bg = 'none' })
|
||||
vim.api.nvim_set_hl(0, 'StatusLineNC', { bg = 'none' })
|
||||
vim.api.nvim_set_hl(0, 'GitSignsAdd', { fg = 'green', bold = true })
|
||||
vim.api.nvim_set_hl(0, 'GitSignsDelete', { fg = 'red', bold = true })
|
||||
vim.api.nvim_set_hl(0, 'GitSignsChange', { fg = 'green', bold = true })
|
||||
end)
|
||||
end,
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ return {
|
|||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
'tiagovla/scope.nvim',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
return {
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
lazy = false,
|
||||
event = 'VeryLazy',
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-context',
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue