Compare commits

...

15 Commits

20 changed files with 471 additions and 394 deletions

View File

@@ -30,11 +30,18 @@ require('lazy').setup({
priority = 1000,
lazy = false,
config = function()
vim.g.gruvbox_material_background = 'soft'
vim.o.background = 'dark'
vim.g.gruvbox_material_background = 'light'
vim.g.gruvbox_material_better_performance = 1
vim.g.gruvbox_material_diagnostic_line_highlight = 1
vim.g.gruvbox_material_diagnostic_virtual_text = 'colored'
vim.g.gruvbox_material_enable_bold = 1
vim.g.gruvbox_material_enable_italic = 1
vim.cmd.colorscheme 'gruvbox-material'
-- changing bg and border colors
vim.api.nvim_set_hl(0, 'FloatBorder', { link = 'Normal' })
vim.api.nvim_set_hl(0, 'LspInfoBorder', { link = 'Normal' })
vim.api.nvim_set_hl(0, 'NormalFloat', { link = 'Normal' })
end,
},

View File

@@ -1,4 +1,29 @@
vim.api.nvim_create_autocmd({ 'BufEnter, BufWinEnter' }, { command = 'set colorcolumn=120,80,88', pattern = { '*.py', '*.pyi' } })
vim.api.nvim_create_autocmd({ 'BufEnter, BufWinEnter' }, { command = 'set colorcolumn=80,100', pattern = { '*.rs' } })
vim.api.nvim_create_autocmd({ 'BufEnter, BufWinEnter' }, { command = 'set splitright', pattern = { '*' } })
vim.api.nvim_create_autocmd({ 'BufEnter, BufWinEnter' }, { command = 'set splitbelow', pattern = { '*' } })
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWinEnter' }, { command = 'set colorcolumn=79,80,88,120', pattern = { '*.py', '*.pyi' } })
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWinEnter' }, { command = 'set colorcolumn=80,100', pattern = { '*.rs' } })
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWinEnter' }, { command = 'set splitright', pattern = { '*' } })
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWinEnter' }, { command = 'set splitbelow', pattern = { '*' } })
-- [[ Highlight on yank ]]
-- See `:help vim.highlight.on_yank()`
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
vim.api.nvim_create_autocmd('TextYankPost', {
callback = function()
vim.highlight.on_yank()
end,
group = highlight_group,
pattern = '*',
})
vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
pattern = '*.gitlab-ci*.{yml,yaml}',
callback = function()
vim.bo.filetype = 'yaml.gitlab'
end,
})
vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
pattern = vim.fn.expand '~' .. '/.ssh/config.d/*.config',
callback = function()
vim.bo.filetype = 'sshconfig'
end,
})

View File

@@ -20,17 +20,6 @@ vim.keymap.set('n', 'N', 'Nzzzv', { noremap = true, silent = true })
vim.keymap.set('v', '<M-k>', ":m '<-2<cr>gv=gv", { desc = 'Move selected lines up' })
vim.keymap.set('v', '<M-j>', ":m '>+1<cr>gv=gv", { desc = 'Move selected lines down' })
-- [[ Highlight on yank ]]
-- See `:help vim.highlight.on_yank()`
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
vim.api.nvim_create_autocmd('TextYankPost', {
callback = function()
vim.highlight.on_yank()
end,
group = highlight_group,
pattern = '*',
})
-- Diagnostic keymaps
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
@@ -39,3 +28,6 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist)
-- terminal
vim.keymap.set('t', '<C-x>', vim.api.nvim_replace_termcodes('<C-\\><C-N>', true, true, true), { desc = 'Escape terminal mode' })
-- disabling highlight
vim.keymap.set('n', '<leader>hh', ':noh<CR>', { desc = 'No highlight search' })

View File

@@ -6,7 +6,7 @@ vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- Set highlight on search
vim.o.hlsearch = false
vim.o.hlsearch = true
-- Make line numbers default
vim.wo.number = true
@@ -14,9 +14,6 @@ vim.wo.number = true
-- Make line numbers relative
vim.wo.relativenumber = true
-- Enable mouse mode
vim.o.mouse = 'a'
-- Enable break indent
vim.o.breakindent = true
@@ -39,3 +36,10 @@ vim.o.timeoutlen = 300
vim.o.completeopt = 'menuone,noselect'
vim.o.termguicolors = true
-- eol chars
vim.opt.list = true
vim.opt.listchars = {
eol = '󰌑',
tab = '<->',
}

59
lua/plugins/alpha.lua Normal file
View File

@@ -0,0 +1,59 @@
return {
'goolord/alpha-nvim',
dependencies = {
'nvim-tree/nvim-web-devicons',
},
config = function()
local alpha = require 'alpha'
local dashboard = require 'alpha.themes.dashboard'
dashboard.section.header.val = {
[[ ]],
[[ ]],
[[ ]],
[[ ]],
[[ ]],
[[ ]],
[[ ]],
[[ ]],
[[ ]],
[[ ]],
[[ ]],
[[ ]],
[[  ]],
[[ ████ ██████ █████ ██ ]],
[[ ███████████ █████  ]],
[[ █████████ ███████████████████ ███ ███████████ ]],
[[ █████████ ███ █████████████ █████ ██████████████ ]],
[[ █████████ ██████████ █████████ █████ █████ ████ █████ ]],
[[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]],
[[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]],
[[ ]],
[[ ]],
[[ ]],
}
dashboard.section.buttons.val = {
dashboard.button('e', 'New file', '<cmd>ene <CR>'),
dashboard.button('SPC s f', 'Search files'),
dashboard.button('SPC s g', 'Search grep'),
dashboard.button('SPC s r', 'Search resume'),
dashboard.button('SPC SPC', 'Open buffers'),
dashboard.button('SPC h t', 'Harpoon terminal'),
}
_Gopts = {
position = 'center',
hl = 'Type',
}
local function footer()
return os.date 'It was %H:%M:%S when this buffer was opened on %d. %m. %Y, a %A in %B.'
end
dashboard.section.footer.val = footer()
dashboard.opts.opts.noautocmd = true
alpha.setup(dashboard.opts)
end,
}

View File

@@ -1,93 +0,0 @@
function leave_snippet()
if
((vim.v.event.old_mode == 's' and vim.v.event.new_mode == 'n') or vim.v.event.old_mode == 'i')
and require('luasnip').session.current_nodes[vim.api.nvim_get_current_buf()]
and not require('luasnip').session.jump_active
then
require('luasnip').unlink_current()
end
end
vim.api.nvim_command [[
autocmd ModeChanged * lua leave_snippet()
]]
vim.cmd 'highlight! link CmpPmenu Pmenu'
vim.cmd 'highlight! link CmpPmenuBorder Pmenu'
vim.cmd 'highlight! CmpPmenu guibg=#282828'
vim.cmd 'highlight! CmpPmenuBorder guifg=#615750'
return {
{
'hrsh7th/nvim-cmp',
dependencies = {
'hrsh7th/cmp-nvim-lsp',
'L3MON4D3/LuaSnip',
'saadparwaiz1/cmp_luasnip',
'rafamadriz/friendly-snippets',
},
config = function()
-- nvim-cmp setup
local cmp = require 'cmp'
local luasnip = require 'luasnip'
require('luasnip.loaders.from_vscode').lazy_load()
local border = require('utils').nvim_open_win_border
luasnip.config.setup {}
local highlight_opts = 'Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None'
cmp.setup {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert {
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete {},
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' }),
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'crates' },
},
window = {
completion = {
border = border 'CmpBorder',
side_padding = 1,
winhighlight = highlight_opts,
},
documentation = {
border = border 'CmpDocBorder',
winhighlight = highlight_opts,
},
},
}
end,
},
}

117
lua/plugins/completions.lua Normal file
View File

@@ -0,0 +1,117 @@
-- function Leave_snippet()
-- if
-- ((vim.v.event.old_mode == 's' and vim.v.event.new_mode == 'n') or vim.v.event.old_mode == 'i')
-- and require('luasnip').session.current_nodes[vim.api.nvim_get_current_buf()]
-- and not require('luasnip').session.jump_active
-- then
-- require('luasnip').unlink_current()
-- end
-- end
--
-- vim.api.nvim_command [[
-- autocmd ModeChanged * lua Leave_snippet()
-- ]]
--
-- vim.cmd 'highlight! link CmpPmenu Pmenu'
-- vim.cmd 'highlight! link CmpPmenuBorder Pmenu'
-- vim.cmd 'highlight! CmpPmenu guibg=#282828'
-- vim.cmd 'highlight! CmpPmenuBorder guifg=#615750'
return {
{
'hrsh7th/nvim-cmp',
event = 'InsertEnter',
dependencies = {
-- Snippet Engine & its associated nvim-cmp source
{
'L3MON4D3/LuaSnip',
build = (function()
-- Build Step is needed for regex support in snippets.
-- This step is not supported in many windows environments.
-- Remove the below condition to re-enable on windows.
if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then
return
end
return 'make install_jsregexp'
end)(),
dependencies = {
-- `friendly-snippets` contains a variety of premade snippets.
-- See the README about individual language/framework/plugin snippets:
-- https://github.com/rafamadriz/friendly-snippets
{
'rafamadriz/friendly-snippets',
config = function()
require('luasnip.loaders.from_vscode').lazy_load()
end,
},
},
},
'saadparwaiz1/cmp_luasnip',
-- Adds other completion capabilities.
-- nvim-cmp does not ship with all sources by default. They are split
-- into multiple repos for maintenance purposes.
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path',
},
config = function()
local cmp = require 'cmp'
local luasnip = require 'luasnip'
luasnip.config.setup {}
local border = require('utils').nvim_open_win_border
local highlight_opts = 'Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None'
cmp.setup {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
completion = { completeopt = 'menu,menuone,noinsert' },
mapping = cmp.mapping.preset.insert {
['<C-n>'] = cmp.mapping.select_next_item(),
['<C-p>'] = cmp.mapping.select_prev_item(),
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-y>'] = cmp.mapping.confirm { select = true },
['<C-Space>'] = cmp.mapping.complete {},
['<C-l>'] = cmp.mapping(function()
if luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
end
end, { 'i', 's' }),
['<C-h>'] = cmp.mapping(function()
if luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
end
end, { 'i', 's' }),
},
sources = {
{
name = 'lazydev',
-- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
group_index = 0,
},
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'path' },
-- { name = 'crates' },
},
window = {
completion = {
border = border 'CmpBorder',
side_padding = 1,
winhighlight = highlight_opts,
},
documentation = {
border = border 'CmpDocBorder',
winhighlight = highlight_opts,
},
},
}
end,
},
}

View File

@@ -4,6 +4,7 @@ return {
require('gitlinker').setup {
callbacks = {
['git.aflabs.org'] = require('gitlinker.hosts').get_gitlab_type_url,
['git.janezic.dev'] = require('gitlinker.hosts').get_gitea_type_url,
},
}
end,

View File

@@ -3,8 +3,6 @@ return {
'lukas-reineke/indent-blankline.nvim',
-- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help indent_blankline.txt`
opts = {
char = '',
show_trailing_blankline_indent = false,
},
main = 'ibl',
opts = { scope = { show_start = false, show_end = false } },
}

View File

@@ -1,7 +0,0 @@
return {
'ggandor/leap.nvim',
dependencies = { 'tpope/vim-repeat' },
config = function()
require('leap').add_default_mappings()
end,
}

View File

@@ -1,118 +1,150 @@
local on_attach = function(_, bufnr)
local nmap = function(keys, func, desc)
if desc then
desc = 'LSP: ' .. desc
end
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('kickstart-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('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' })
map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
map('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
local delayed_format = function()
vim.lsp.buf.format { timeout_ms = 2000 }
end
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
nmap('<leader>ff', delayed_format, '[F]ormat')
map('<leader>ff', delayed_format, '[F]ormat')
--
-- -- See `:help K` for why this keymap
-- nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
-- nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation')
nmap('<leader>D', vim.lsp.buf.type_definition, 'Type [D]efinition')
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
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('kickstart-lsp-highlight', { clear = false })
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
buffer = event.buf,
group = highlight_augroup,
callback = vim.lsp.buf.document_highlight,
})
-- See `:help K` for why this keymap
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
buffer = event.buf,
group = highlight_augroup,
callback = vim.lsp.buf.clear_references,
})
-- Lesser used LSP functionality
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
nmap('<leader>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, '[W]orkspace [L]ist Folders')
vim.api.nvim_create_autocmd('LspDetach', {
group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }),
callback = function(event2)
vim.lsp.buf.clear_references()
vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf }
end,
})
end
-- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
vim.lsp.buf.format()
end, { desc = 'Format current buffer with LSP' })
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,
})
return {
{
-- LSP Configuration & Plugins
'neovim/nvim-lspconfig',
dependencies = {
-- Automatically install LSPs to stdpath for neovim
'williamboman/mason.nvim',
-- Automatically install LSPs and related tools to stdpath for Neovim
{ 'williamboman/mason.nvim', config = true }, -- NOTE: Must be loaded before dependants
'williamboman/mason-lspconfig.nvim',
'WhoIsSethDaniel/mason-tool-installer.nvim',
-- adds extra functionality over rust_analyzer
'simrat39/rust-tools.nvim',
-- Useful status updates for LSP
-- Useful status updates for LSP.
{ 'j-hui/fidget.nvim', opts = {} },
-- Additional lua configuration, makes nvim stuff amazing!
'folke/neodev.nvim',
-- Allows extra capabilities provided by nvim-cmp
'hrsh7th/cmp-nvim-lsp',
{
'mrcjkb/rustaceanvim',
version = '^4',
ft = { 'rust' },
},
{
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
-- used for completion, annotations and signatures of Neovim apis
'folke/lazydev.nvim',
ft = 'lua',
opts = {
library = {
-- Load luvit types when the `vim.uv` word is found
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
},
},
},
{ 'Bilal2453/luvit-meta', lazy = true },
},
config = function()
local servers = {
clangd = {},
gopls = {},
marksman = {},
pyright = {},
tsserver = {},
gopls = {},
ruff = {},
pyright = {
pyright = {
disableOrganizeImports = true,
},
},
ts_ls = {},
lua_ls = {
Lua = {
workspace = { checkThirdParty = false },
telemetry = { enable = false },
},
},
stylua = {},
}
-- Setup neovim lua configuration
require('neodev').setup()
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
-- Setup mason so it can manage external tooling
require('mason').setup()
-- Ensure the servers above are installed
local mason_lspconfig = require 'mason-lspconfig'
require('mason-tool-installer').setup { ensure_installed = vim.tbl_keys(servers) }
mason_lspconfig.setup {
ensure_installed = vim.tbl_keys(servers),
}
mason_lspconfig.setup_handlers {
require('mason-lspconfig').setup {
handlers = {
function(server_name)
require('lspconfig')[server_name].setup {
capabilities = capabilities,
on_attach = on_attach,
settings = servers[server_name],
}
local server = servers[server_name] or {}
-- This handles overriding only values explicitly passed
-- by the server configuration above. Useful when disabling
-- certain features of an LSP (for example, turning off formatting for ts_ls)
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
require('lspconfig')[server_name].setup(server)
end,
},
}
local rust_tools_opts = {
vim.g.rustaceanvim = {
tools = {
runnables = {
use_telescope = true,
},
inlay_hints = {
auto = true,
show_parameter_hints = false,
parameter_hints_prefix = '',
other_hints_prefix = '',
auto = false,
},
},
server = {
on_attach = on_attach,
settings = {
['rust-analyzer'] = {
cargo = {
@@ -123,12 +155,17 @@ return {
checkOnSave = {
command = 'clippy',
},
-- leave rainbow higlight to plugin
rainbowHighlightOn = false,
useLibraryCodeForTypes = true,
autoSearchPaths = true,
autoImportCompletions = false,
reportMissingImports = true,
followImportForHints = true,
},
},
},
}
require('rust-tools').setup(rust_tools_opts)
end,
},
}

View File

@@ -1,15 +0,0 @@
return {
'SmiteshP/nvim-navbuddy',
dependencies = {
'neovim/nvim-lspconfig',
'SmiteshP/nvim-navic',
'MunifTanjim/nui.nvim',
},
config = function()
require('nvim-navbuddy').setup { lsp = { auto_attach = true } }
-- Plugins
vim.keymap.set('n', '<leader>nb', ':Navbuddy<CR>', { desc = '[N]av[b]uddy' })
vim.keymap.set('n', '<leader>nt', ':NvimTreeToggle<CR>', { desc = '[N]vim[T]ree' })
end,
}

6
lua/plugins/neogen.lua Normal file
View File

@@ -0,0 +1,6 @@
return {
'danymat/neogen',
config = true,
-- Uncomment next line if you want to follow only stable versions
-- version = "*"
}

23
lua/plugins/none_ls.lua Normal file
View File

@@ -0,0 +1,23 @@
return {
-- inject lsp formatting, diagonstics etc
'nvimtools/none-ls.nvim',
dependencies = {
'nvim-lua/plenary.nvim',
},
config = function()
local none_ls = require 'null-ls'
none_ls.setup {
sources = {
-- general
none_ls.builtins.code_actions.gitsigns,
-- python
-- none_ls.builtins.formatting.black,
-- typescript
none_ls.builtins.formatting.prettier,
-- lua
none_ls.builtins.formatting.stylua,
},
}
end,
}

View File

@@ -1,23 +0,0 @@
return {
-- inject lsp formatting, diagonstics etc
'jose-elias-alvarez/null-ls.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
local null_ls = require 'null-ls'
null_ls.setup {
sources = {
-- general
null_ls.builtins.code_actions.gitsigns,
-- python
-- null_ls.builtins.diagnostics.pylint,
null_ls.builtins.formatting.black,
null_ls.builtins.formatting.isort,
-- typescript
null_ls.builtins.formatting.prettier,
-- lua
null_ls.builtins.formatting.stylua,
},
}
end,
}

View File

@@ -2,7 +2,7 @@ return {
'stevearc/oil.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
require('oil').setup()
require('oil').setup { view_options = { show_hidden = true } }
vim.keymap.set('n', '-', require('oil').open, { desc = 'Open parent directory' })
end,
}

View File

@@ -0,0 +1,3 @@
return {
'HiPhish/rainbow-delimiters.nvim',
}

View File

@@ -3,14 +3,11 @@ return {
{
-- Fuzzy Finder (files, lsp, etc)
'nvim-telescope/telescope.nvim',
version = '*',
branch = '0.1.x',
dependencies = {
'nvim-lua/plenary.nvim',
{
'nvim-telescope/telescope-fzf-native.nvim',
-- NOTE: If you are having trouble with this installation,
-- refer to the README for telescope-fzf-native for more instructions.
build = 'make',
cond = function()
return vim.fn.executable 'make' == 1
@@ -18,43 +15,43 @@ return {
},
},
config = function()
local telescopeConfig = require 'telescope.config'
-- Clone the default Telescope configuration
local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) }
-- I want to search in hidden/dot files.
table.insert(vimgrep_arguments, '--hidden')
-- I don't want to respect .gitignore but do want to respect .ignore
table.insert(vimgrep_arguments, '--no-ignore-vcs')
-- I don't want to search in the `.git` directory.
table.insert(vimgrep_arguments, '--glob')
table.insert(vimgrep_arguments, '!**/.git/*')
local rg_defaults = { 'rg', '-S', '--hidden', '--no-ignore-vcs', '--glob', '!**/.git/*' }
local find_command = { unpack(rg_defaults) }
table.insert(find_command, '--files')
local grep_command = { unpack(rg_defaults) }
table.insert(grep_command, '--color=never')
table.insert(grep_command, '--no-heading')
table.insert(grep_command, '--with-filename')
table.insert(grep_command, '--line-number')
table.insert(grep_command, '--column')
-- [[ Configure Telescope ]]
-- See `:help telescope` and `:help telescope.setup()`
require('telescope').setup {
defaults = {
mappings = {
i = {
['<C-u>'] = false,
['<C-d>'] = false,
},
},
vimgrep_arguments = vimgrep_arguments,
},
pickers = {
find_files = {
find_command = {
'rg',
'-S',
'--no-ignore-vcs',
'--hidden',
'--files',
'-g',
'!.git',
},
find_command = find_command,
},
live_grep = {
grep_command = {
'rg',
'--no-ignore-vcs',
'--hidden',
'--color=never',
'--no-heading',
'--with-filename',
'--line-number',
'--column',
'--smart-case',
'-g',
'!.git',
},
grep_command = grep_command,
},
},
}
@@ -62,19 +59,9 @@ return {
-- Enable telescope fzf native, if installed
pcall(require('telescope').load_extension, 'fzf')
-- Enable harpoon
require('telescope').load_extension 'harpoon'
-- See `:help telescope.builtin`
vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' })
vim.keymap.set('n', '<leader><space>', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' })
vim.keymap.set('n', '<leader>/', function()
-- You can pass additional configuration to telescope to change theme, layout, etc.
require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
winblend = 10,
previewer = false,
})
end, { desc = '[/] Fuzzily search in current buffer' })
vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' })
vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' })
@@ -82,18 +69,7 @@ return {
vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' })
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })
vim.keymap.set('n', '<leader>ss', require('telescope.builtin').spell_suggest, { desc = '[S]pell [S]suggest' })
vim.keymap.set('n', '<leader>sc', function()
require('telescope.builtin').colorscheme { enable_preview = true }
end, { desc = '[S]earch [C]olorscheme' })
-- extensions
vim.api.nvim_set_keymap('n', '<leader>tc', ':TodoTelescope<CR>', { desc = '[T]odo [c]omments', noremap = true })
vim.api.nvim_set_keymap('n', '<leader>hm', ':Telescope harpoon marks<CR>', { desc = '[H]arpoon [m]arks', noremap = true })
vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' })
end,
},
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
-- Only load if `make` is available. Make sure you have the system
-- requirements installed.
}

View File

@@ -1,38 +1,43 @@
return {
-- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects',
'nvim-treesitter/nvim-treesitter-context',
'nvim-treesitter/nvim-treesitter-refactor',
},
dependencies = { 'nvim-treesitter/nvim-treesitter-textobjects' },
config = function()
pcall(require('nvim-treesitter.install').update { with_sync = true })
-- [[ Configure Treesitter ]]
-- See `:help nvim-treesitter`
vim.defer_fn(function()
require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim', 'markdown' },
ensure_installed = {
'c',
'cpp',
'go',
'lua',
'python',
'rust',
'tsx',
'typescript',
'vimdoc',
'vim',
'markdown',
},
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = true,
highlight = { enable = true },
indent = { enable = true, disable = { 'python' } },
indent = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = '<C-Space>',
node_incremental = '<C-Space>',
scope_incremental = '<C-M-Space>',
node_decremental = '<C-Bslash>',
init_selection = '<c-space>',
node_incremental = '<c-space>',
scope_incremental = '<c-M-space>',
node_decremental = '<c-bslash>',
},
},
-- refactor
refactor = {
highlight_definitions = { enable = true, clear_on_cursor_move = true },
},
-- textobjects
textobjects = {
select = {
@@ -79,5 +84,6 @@ return {
},
},
}
end, 0)
end,
}

View File

@@ -1,39 +0,0 @@
return {
-- a more adventurous wildmenu
'gelguy/wilder.nvim',
dependencies = { 'romgrk/fzy-lua-native' },
config = function()
local wilder = require 'wilder'
wilder.setup { modes = { ':', '/', '?' } }
-- Disable Python remote plugin
wilder.set_option('use_python_remote_plugin', 0)
wilder.set_option('pipeline', {
wilder.branch(
wilder.cmdline_pipeline {
fuzzy = 1,
fuzzy_filter = wilder.lua_fzy_filter(),
},
wilder.vim_search_pipeline()
),
})
wilder.set_option(
'renderer',
wilder.popupmenu_renderer(wilder.popupmenu_border_theme {
highlights = {
border = 'Normal',
},
-- stylua: ignore
border = {
'', '', '',
'', '',
'', '', '',
},
highlighter = wilder.lua_fzy_highlighter(),
left = { ' ', wilder.popupmenu_devicons() },
right = { ' ', wilder.popupmenu_scrollbar() },
})
)
end,
}