format all lua files
This commit is contained in:
parent
fa0d4ffd8f
commit
b87bbaee74
@ -1,76 +1,77 @@
|
|||||||
|
vim.cmd('filetype plugin indent on')
|
||||||
vim.cmd('filetype plugin indent on')
|
vim.cmd('language en_US.utf-8')
|
||||||
vim.cmd('language en_US.utf-8')
|
|
||||||
|
local opt = vim.opt
|
||||||
local opt = vim.opt
|
local indent = 2
|
||||||
local indent = 2
|
opt.termguicolors = true -- Enable colors in terminal
|
||||||
opt.termguicolors = true -- Enable colors in terminal
|
opt.hlsearch = true --Set highlight on search
|
||||||
opt.hlsearch = true --Set highlight on search
|
opt.number = true --Make line numbers default
|
||||||
opt.number = true --Make line numbers default
|
opt.relativenumber = false --Make relative number default
|
||||||
opt.relativenumber = false --Make relative number default
|
opt.mouse = 'a' --Enable mouse mode
|
||||||
opt.mouse = 'a' --Enable mouse mode
|
opt.breakindent = true --Enable break indent
|
||||||
opt.breakindent = true --Enable break indent
|
opt.undofile = true --Save undo history
|
||||||
opt.undofile = true --Save undo history
|
opt.ignorecase = true --Case insensitive searching unless /C or capital in search
|
||||||
opt.ignorecase = true --Case insensitive searching unless /C or capital in search
|
opt.smartcase = true -- Smart case
|
||||||
opt.smartcase = true -- Smart case
|
opt.updatetime = 300 --Decrease update time
|
||||||
opt.updatetime = 300 --Decrease update time
|
opt.signcolumn = 'yes' -- Always show sign column
|
||||||
opt.signcolumn = 'yes' -- Always show sign column
|
opt.timeoutlen = 300 -- Time in milliseconds to wait for a mapped sequence to complete.
|
||||||
opt.timeoutlen = 300 -- Time in milliseconds to wait for a mapped sequence to complete.
|
opt.ttimeoutlen = 10
|
||||||
opt.ttimeoutlen = 10
|
opt.showmode = false -- Do not need to show the mode. We use the statusline instead.
|
||||||
opt.showmode = false -- Do not need to show the mode. We use the statusline instead.
|
opt.scrolloff = 999 -- Lines of context
|
||||||
opt.scrolloff = 999 -- Lines of context
|
opt.joinspaces = false -- No double spaces with join after a dot
|
||||||
opt.joinspaces = false -- No double spaces with join after a dot
|
opt.showmatch = true -- Show matching braces
|
||||||
opt.showmatch = true -- Show matching braces
|
opt.wrap = true -- When on, lines longer than the width of the window will wrap and displaying continues on the next line
|
||||||
opt.wrap = true -- When on, lines longer than the width of the window will wrap and displaying continues on the next line
|
opt.list = true
|
||||||
opt.list = true
|
opt.hidden = true
|
||||||
opt.hidden= true
|
opt.scrolloff = 4
|
||||||
opt.scrolloff= 4
|
opt.shiftround = true
|
||||||
opt.shiftround= true
|
opt.relativenumber = false
|
||||||
opt.relativenumber= false
|
opt.splitbelow = true
|
||||||
opt.splitbelow= true
|
opt.splitright = true
|
||||||
opt.splitright= true
|
opt.wildmode = 'longest:full,full'
|
||||||
opt.wildmode= 'longest:full,full'
|
opt.splitbelow = true
|
||||||
opt.splitbelow= true
|
opt.splitright = true
|
||||||
opt.splitright= true
|
opt.shiftwidth = indent
|
||||||
opt.shiftwidth = indent
|
opt.tabstop = indent
|
||||||
opt.tabstop = indent
|
if vim.fn.has('wsl') == 1 then
|
||||||
if vim.fn.has("wsl") == 1 then
|
vim.g.clipboard = {
|
||||||
vim.g.clipboard = {
|
name = 'WslClipboard',
|
||||||
name = 'WslClipboard',
|
copy = {
|
||||||
copy = {
|
['+'] = 'clip.exe',
|
||||||
['+'] = 'clip.exe',
|
['*'] = 'clip.exe',
|
||||||
['*'] = 'clip.exe',
|
},
|
||||||
},
|
paste = {
|
||||||
paste = {
|
['+'] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
|
||||||
['+'] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
|
['*'] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
|
||||||
['*'] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
|
},
|
||||||
},
|
cache_enabled = 0,
|
||||||
cache_enabled = 0,
|
}
|
||||||
}
|
opt.guifont = 'JetBrainsMonoNL NF:h9' -- https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/JetBrainsMono/NoLigatures/Regular/complete/JetBrains%20Mono%20NL%20Regular%20Nerd%20Font%20Complete%20Mono%20Windows%20Compatible.ttf
|
||||||
opt.guifont= 'JetBrainsMonoNL NF:h9' -- https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/JetBrainsMono/NoLigatures/Regular/complete/JetBrains%20Mono%20NL%20Regular%20Nerd%20Font%20Complete%20Mono%20Windows%20Compatible.ttf
|
|
||||||
elseif vim.loop.os_uname().sysname == 'Linux' then
|
elseif vim.loop.os_uname().sysname == 'Linux' then
|
||||||
opt.guifont= 'JetBrainsMono Nerd Font Mono:h7'
|
opt.guifont = 'JetBrainsMono Nerd Font Mono:h7'
|
||||||
else
|
else
|
||||||
opt.guifont= 'JetBrainsMonoNL NF:h9' -- https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/JetBrainsMono/NoLigatures/Regular/complete/JetBrains%20Mono%20NL%20Regular%20Nerd%20Font%20Complete%20Mono%20Windows%20Compatible.ttf
|
opt.guifont = 'JetBrainsMonoNL NF:h9' -- https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/JetBrainsMono/NoLigatures/Regular/complete/JetBrains%20Mono%20NL%20Regular%20Nerd%20Font%20Complete%20Mono%20Windows%20Compatible.ttf
|
||||||
end
|
end
|
||||||
opt.swapfile= false
|
opt.swapfile = false
|
||||||
opt.backup= false
|
opt.backup = false
|
||||||
opt.spelllang= 'en,de'
|
opt.spelllang = 'en,de'
|
||||||
opt.completeopt= 'menu,menuone,noselect'
|
opt.completeopt = 'menu,menuone,noselect'
|
||||||
opt.expandtab= true
|
opt.expandtab = true
|
||||||
opt.smartindent= true
|
opt.smartindent = true
|
||||||
opt.title = true
|
opt.title = true
|
||||||
opt.titlestring = '%{getcwd()} - %t'
|
opt.titlestring = '%{getcwd()} - %t'
|
||||||
opt.laststatus = 3 -- for lualine
|
opt.laststatus = 3 -- for lualine
|
||||||
|
|
||||||
-- go to previous/next line with h,l,left arrow and right arrow
|
-- go to previous/next line with h,l,left arrow and right arrow
|
||||||
-- when cursor reaches end/beginning of line
|
-- when cursor reaches end/beginning of line
|
||||||
-- opt.whichwrap:append('<>[]hl')
|
-- opt.whichwrap:append('<>[]hl')
|
||||||
|
|
||||||
-- disable nvim intro
|
-- disable nvim intro
|
||||||
opt.shortmess:append('sI')
|
opt.shortmess:append('sI')
|
||||||
|
|
||||||
-- Treesitter based folding
|
-- Treesitter based folding
|
||||||
opt.foldlevel = 20
|
opt.foldlevel = 20
|
||||||
opt.foldmethod = 'expr'
|
opt.foldmethod = 'expr'
|
||||||
opt.foldexpr = 'nvim_treesitter#foldexpr()'
|
opt.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||||
|
opt.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||||
|
@ -38,14 +38,14 @@ api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
|
|||||||
group = fileGrp,
|
group = fileGrp,
|
||||||
})
|
})
|
||||||
api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
|
api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
|
||||||
pattern = { 'doskey'},
|
pattern = { 'doskey' },
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.bo.filetype = 'dosini'
|
vim.bo.filetype = 'dosini'
|
||||||
end,
|
end,
|
||||||
group = fileGrp,
|
group = fileGrp,
|
||||||
})
|
})
|
||||||
api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
|
api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
|
||||||
pattern = { '.clangd', '.clang-tidy'},
|
pattern = { '.clangd', '.clang-tidy' },
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.bo.filetype = 'yaml'
|
vim.bo.filetype = 'yaml'
|
||||||
end,
|
end,
|
||||||
@ -62,7 +62,8 @@ api.nvim_create_autocmd({ 'FocusLost' }, { command = [[wshada]] })
|
|||||||
-- )
|
-- )
|
||||||
|
|
||||||
-- Check if we need to reload the file when it changed
|
-- Check if we need to reload the file when it changed
|
||||||
api.nvim_create_autocmd({ 'FocusGained', 'BufEnter' }, { command = [[if !bufexists("[Command Line]") | checktime | endif]] })
|
api.nvim_create_autocmd({ 'FocusGained', 'BufEnter' },
|
||||||
|
{ command = [[if !bufexists("[Command Line]") | checktime | endif]] })
|
||||||
|
|
||||||
-- windows to close with "q"
|
-- windows to close with "q"
|
||||||
api.nvim_create_autocmd(
|
api.nvim_create_autocmd(
|
||||||
@ -82,4 +83,4 @@ api.nvim_create_autocmd(
|
|||||||
api.nvim_create_autocmd('BufEnter', { command = [[set formatoptions-=cro]] })
|
api.nvim_create_autocmd('BufEnter', { command = [[set formatoptions-=cro]] })
|
||||||
|
|
||||||
-- Keep window ratio when resize
|
-- Keep window ratio when resize
|
||||||
api.nvim_create_autocmd('VimResized', {command = [[wincmd =]]})
|
api.nvim_create_autocmd('VimResized', { command = [[wincmd =]] })
|
||||||
|
@ -26,7 +26,7 @@ vim.keymap.set('x', '>', '>gv')
|
|||||||
|
|
||||||
local function hlWord()
|
local function hlWord()
|
||||||
local current_word = vim.call('expand', '<cword>')
|
local current_word = vim.call('expand', '<cword>')
|
||||||
vim.fn.setreg('/', "\\<" .. current_word .. "\\>")
|
vim.fn.setreg('/', '\\<' .. current_word .. '\\>')
|
||||||
vim.opt.hlsearch = true
|
vim.opt.hlsearch = true
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -40,10 +40,10 @@ vim.keymap.set('n', '<C-w>', ':bd<CR>', { desc = 'Close buffer' })
|
|||||||
vim.keymap.set('n', '<space>x', 'za', { desc = 'Toggle fold' })
|
vim.keymap.set('n', '<space>x', 'za', { desc = 'Toggle fold' })
|
||||||
|
|
||||||
|
|
||||||
vim.keymap.set({'n', 'x'}, '<leader>y', '"+y', { desc='Copy from system clipboard'})
|
vim.keymap.set({ 'n', 'x' }, '<leader>y', '"+y', { desc = 'Copy from system clipboard' })
|
||||||
vim.keymap.set({'n', 'x'}, '<leader>Y', '"+yg_', { desc='Copy from system clipboard'})
|
vim.keymap.set({ 'n', 'x' }, '<leader>Y', '"+yg_', { desc = 'Copy from system clipboard' })
|
||||||
vim.keymap.set({'n', 'x'}, '<leader>p', '"+p', { desc='Paste from system clipboard'})
|
vim.keymap.set({ 'n', 'x' }, '<leader>p', '"+p', { desc = 'Paste from system clipboard' })
|
||||||
vim.keymap.set({'n', 'x'}, '<leader>P', '"+P', { desc='Paste from system clipboard'})
|
vim.keymap.set({ 'n', 'x' }, '<leader>P', '"+P', { desc = 'Paste from system clipboard' })
|
||||||
|
|
||||||
vim.api.nvim_create_user_command('WinFont', 'set guifont=JetBrainsMonoNL\\ NF:h9', {})
|
vim.api.nvim_create_user_command('WinFont', 'set guifont=JetBrainsMonoNL\\ NF:h9', {})
|
||||||
vim.api.nvim_create_user_command('LinuxFont', 'set guifont=JetBrainsMono\\ Nerd\\ Font\\ Mono:h7', {})
|
vim.api.nvim_create_user_command('LinuxFont', 'set guifont=JetBrainsMono\\ Nerd\\ Font\\ Mono:h7', {})
|
||||||
|
@ -1,268 +0,0 @@
|
|||||||
vim.cmd([[
|
|
||||||
augroup packer_user_config
|
|
||||||
autocmd!
|
|
||||||
autocmd BufWritePost my_plugins.lua source <afile> | PackerCompile
|
|
||||||
augroup end
|
|
||||||
]])
|
|
||||||
|
|
||||||
local fn = vim.fn
|
|
||||||
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
|
|
||||||
if fn.empty(fn.glob(install_path)) > 0 then
|
|
||||||
packer_bootstrap = fn.system({
|
|
||||||
'git',
|
|
||||||
'clone',
|
|
||||||
'--depth',
|
|
||||||
'1',
|
|
||||||
'https://github.com/wbthomason/packer.nvim',
|
|
||||||
install_path,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
vim.api.nvim_command('packadd packer.nvim')
|
|
||||||
|
|
||||||
local function get_setup(name)
|
|
||||||
return string.format('require("setup/%s")', name)
|
|
||||||
end
|
|
||||||
|
|
||||||
local packerUtil = require('packer.util')
|
|
||||||
require('packer').init({
|
|
||||||
snapshot_path = packerUtil.join_paths(vim.fn.stdpath('config'), 'snapshots'),
|
|
||||||
display = {
|
|
||||||
open_fn = require('packer.util').float,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
return require('packer').startup(function()
|
|
||||||
-- Packer can manage itself as an optional plugin
|
|
||||||
use({ 'wbthomason/packer.nvim' })
|
|
||||||
use({
|
|
||||||
'nvim-treesitter/nvim-treesitter',
|
|
||||||
run = ':TSUpdate',
|
|
||||||
config = get_setup('treesitter'),
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
'nvim-telescope/telescope.nvim',
|
|
||||||
requires = {
|
|
||||||
{ 'nvim-lua/popup.nvim' },
|
|
||||||
{ 'nvim-lua/plenary.nvim' },
|
|
||||||
{ 'kyazdani42/nvim-web-devicons' },
|
|
||||||
{ 'nvim-telescope/telescope-fzf-native.nvim',
|
|
||||||
run = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -G Ninja && cmake --build build --config Release && cmake --install build --prefix build' },
|
|
||||||
},
|
|
||||||
config = get_setup('telescope'),
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
'sainnhe/gruvbox-material',
|
|
||||||
disable = true,
|
|
||||||
config = get_setup('my_gruvbox-material')
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
'luisiacc/gruvbox-baby',
|
|
||||||
disable = true,
|
|
||||||
config = get_setup('my_gruvbox-baby')
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
'ellisonleao/gruvbox.nvim',
|
|
||||||
disable = true,
|
|
||||||
config = get_setup('gruvbox'),
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
'eddyekofo94/gruvbox-flat.nvim',
|
|
||||||
disable = false,
|
|
||||||
config = get_setup('my_gruvbox_flat')
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
'lukas-reineke/indent-blankline.nvim',
|
|
||||||
requires = {
|
|
||||||
'nvim-treesitter/nvim-treesitter',
|
|
||||||
},
|
|
||||||
config = get_setup('indent_blankline'),
|
|
||||||
})
|
|
||||||
use({ 'nvim-lua/plenary.nvim' })
|
|
||||||
use({
|
|
||||||
'lewis6991/gitsigns.nvim',
|
|
||||||
config = get_setup('gitsigns'),
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
'kyazdani42/nvim-tree.lua',
|
|
||||||
requires = 'kyazdani42/nvim-web-devicons',
|
|
||||||
config = get_setup('nvim-tree'),
|
|
||||||
disable = true,
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
'numToStr/Comment.nvim',
|
|
||||||
config = get_setup('comment'),
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
'hrsh7th/nvim-cmp',
|
|
||||||
requires = {
|
|
||||||
{ 'hrsh7th/cmp-buffer' },
|
|
||||||
{ 'hrsh7th/cmp-nvim-lsp' },
|
|
||||||
{ 'L3MON4D3/LuaSnip' },
|
|
||||||
{ 'saadparwaiz1/cmp_luasnip' },
|
|
||||||
{ 'hrsh7th/cmp-nvim-lua' },
|
|
||||||
{ 'octaltree/cmp-look' },
|
|
||||||
{ 'hrsh7th/cmp-path' },
|
|
||||||
{ 'hrsh7th/cmp-calc' },
|
|
||||||
{ 'f3fora/cmp-spell' },
|
|
||||||
{ 'hrsh7th/cmp-emoji' },
|
|
||||||
{ 'hrsh7th/cmp-cmdline' },
|
|
||||||
{ 'dmitmel/cmp-cmdline-history' },
|
|
||||||
{ 'ray-x/cmp-treesitter' },
|
|
||||||
{ 'hrsh7th/cmp-nvim-lsp-signature-help' },
|
|
||||||
{ 'p00f/clangd_extensions.nvim' },
|
|
||||||
{ 'rcarriga/cmp-dap',
|
|
||||||
opt = true,
|
|
||||||
module = 'cmp_dap' },
|
|
||||||
},
|
|
||||||
config = get_setup('my_cmp'),
|
|
||||||
})
|
|
||||||
use({ 'L3MON4D3/LuaSnip', config = get_setup('luasnip') })
|
|
||||||
use({ 'rafamadriz/friendly-snippets' })
|
|
||||||
use({ 'onsails/lspkind-nvim' })
|
|
||||||
use({
|
|
||||||
'hoob3rt/lualine.nvim',
|
|
||||||
requires = { 'kyazdani42/nvim-web-devicons', opt = true },
|
|
||||||
config = get_setup('lualine'),
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
'ahmedkhalf/project.nvim',
|
|
||||||
config = get_setup('project'),
|
|
||||||
})
|
|
||||||
use({ 'p00f/nvim-ts-rainbow',
|
|
||||||
requires = 'nvim-treesitter/nvim-treesitter',
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
'windwp/nvim-autopairs',
|
|
||||||
config = get_setup('nvim-autopairs'),
|
|
||||||
})
|
|
||||||
use({ 'ray-x/lsp_signature.nvim' })
|
|
||||||
use({
|
|
||||||
'neovim/nvim-lspconfig',
|
|
||||||
requires = {
|
|
||||||
'williamboman/mason.nvim',
|
|
||||||
'williamboman/mason-lspconfig.nvim',
|
|
||||||
'p00f/clangd_extensions.nvim',
|
|
||||||
},
|
|
||||||
config = get_setup('my_lspconfig'),
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
'jose-elias-alvarez/null-ls.nvim',
|
|
||||||
requires = { 'nvim-lua/plenary.nvim' },
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
'danymat/neogen',
|
|
||||||
requires = 'nvim-treesitter/nvim-treesitter',
|
|
||||||
config = get_setup('neogen'),
|
|
||||||
opt = true,
|
|
||||||
module = 'neogen'
|
|
||||||
})
|
|
||||||
use({ 'stevearc/dressing.nvim' })
|
|
||||||
use({
|
|
||||||
'nvim-neo-tree/neo-tree.nvim',
|
|
||||||
requires = {
|
|
||||||
'nvim-lua/plenary.nvim',
|
|
||||||
'kyazdani42/nvim-web-devicons',
|
|
||||||
{ 'MunifTanjim/nui.nvim', module = 'nui' },
|
|
||||||
},
|
|
||||||
config = get_setup('neo-tree'),
|
|
||||||
opt = true,
|
|
||||||
keys = {
|
|
||||||
{ 'n', '\\' }
|
|
||||||
}
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
'akinsho/toggleterm.nvim',
|
|
||||||
config = get_setup('toggleterm'),
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
'mrjones2014/legendary.nvim',
|
|
||||||
config = get_setup('my_legendary')
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
'gbprod/yanky.nvim',
|
|
||||||
config = get_setup('yanky')
|
|
||||||
})
|
|
||||||
use {
|
|
||||||
'ldelossa/litee.nvim',
|
|
||||||
disable = true,
|
|
||||||
requires = {
|
|
||||||
'ldelossa/litee-calltree.nvim',
|
|
||||||
'ldelossa/litee-symboltree.nvim',
|
|
||||||
'ldelossa/gh.nvim'
|
|
||||||
},
|
|
||||||
config = get_setup('my_litee')
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'stevearc/aerial.nvim',
|
|
||||||
requires = {
|
|
||||||
'nvim-telescope/telescope.nvim'
|
|
||||||
},
|
|
||||||
config = get_setup('aerial'),
|
|
||||||
opt = true,
|
|
||||||
module = 'aerial',
|
|
||||||
cmd = {'Telescope aerial', 'AerialToggle'},
|
|
||||||
keys = {
|
|
||||||
{ 'n', '<leader>s' },
|
|
||||||
{ 'n', '<A-m>' }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'ggandor/leap.nvim',
|
|
||||||
requires = { 'tpope/vim-repeat' },
|
|
||||||
config = get_setup('my_leap')
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'mfussenegger/nvim-dap',
|
|
||||||
requires = {
|
|
||||||
'mfussenegger/nvim-dap-python',
|
|
||||||
{
|
|
||||||
'theHamsta/nvim-dap-virtual-text',
|
|
||||||
module = 'nvim-dap-virtual-text'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'nvim-telescope/telescope-dap.nvim',
|
|
||||||
module = 'telescope._extensions.dap',
|
|
||||||
requires = 'telescope.nvim',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'rcarriga/nvim-dap-ui',
|
|
||||||
module = 'dapui'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
keys = {
|
|
||||||
{ 'n', '<F5>' },
|
|
||||||
{ 'n', '<F6>' },
|
|
||||||
{ 'n', '<F7>' },
|
|
||||||
{ 'n', '<F8>' },
|
|
||||||
{ 'n', '<F9>' },
|
|
||||||
{ 'n', '<F10>' },
|
|
||||||
{ 'n', '<F11>' },
|
|
||||||
{ 'n', '<S-F11>' }
|
|
||||||
},
|
|
||||||
-- module = 'dap',
|
|
||||||
config = function()
|
|
||||||
require('setup/my_dap')
|
|
||||||
end,
|
|
||||||
opt = true,
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'sindrets/diffview.nvim',
|
|
||||||
requires = 'nvim-lua/plenary.nvim',
|
|
||||||
config = get_setup('my_diffview'),
|
|
||||||
opt = true,
|
|
||||||
cmd = 'DiffviewOpen',
|
|
||||||
module = { 'diffview', 'diffview.actions' }
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'stevearc/overseer.nvim',
|
|
||||||
config = get_setup('my_overseer'),
|
|
||||||
opt = true,
|
|
||||||
keys = {
|
|
||||||
{ 'n', '<F4>' }
|
|
||||||
},
|
|
||||||
module = 'overseer'
|
|
||||||
}
|
|
||||||
if packer_bootstrap then
|
|
||||||
require('packer').sync()
|
|
||||||
end
|
|
||||||
end)
|
|
@ -7,7 +7,7 @@ return {
|
|||||||
require('aerial').setup({
|
require('aerial').setup({
|
||||||
backends = { 'lsp', 'treesitter', 'markdown' },
|
backends = { 'lsp', 'treesitter', 'markdown' },
|
||||||
layout = {
|
layout = {
|
||||||
default_direction = "prefer_left"
|
default_direction = 'prefer_left'
|
||||||
},
|
},
|
||||||
filter_kind = false,
|
filter_kind = false,
|
||||||
show_guides = true,
|
show_guides = true,
|
||||||
@ -18,7 +18,7 @@ return {
|
|||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
'<leader>s',
|
'<leader>s',
|
||||||
function ()
|
function()
|
||||||
require('aerial').toggle()
|
require('aerial').toggle()
|
||||||
end,
|
end,
|
||||||
desc = 'Symbols outline',
|
desc = 'Symbols outline',
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
return {
|
return {
|
||||||
'Civitasv/cmake-tools.nvim',
|
'Civitasv/cmake-tools.nvim',
|
||||||
config = {
|
config = {
|
||||||
cmake_command = "cmake",
|
cmake_command = 'cmake',
|
||||||
cmake_generate_options = { "-D", "CMAKE_EXPORT_COMPILE_COMMANDS=1", '-G', 'Ninja' },
|
cmake_generate_options = { '-D', 'CMAKE_EXPORT_COMPILE_COMMANDS=1', '-G', 'Ninja' },
|
||||||
cmake_show_console = "always",
|
cmake_show_console = 'always',
|
||||||
cmake_build_directory = "build_nvim",
|
cmake_build_directory = 'build_nvim',
|
||||||
cmake_dap_configuration = { name = "cpp", type = "codelldb", request = "launch" }, -- dap configuration, optional
|
cmake_dap_configuration = { name = 'cpp', type = 'codelldb', request = 'launch' }, -- dap configuration, optional
|
||||||
},
|
},
|
||||||
cmd = {
|
cmd = {
|
||||||
'CMakeGenerate',
|
'CMakeGenerate',
|
||||||
|
@ -106,7 +106,7 @@ return {
|
|||||||
-- { name = 'emoji' },
|
-- { name = 'emoji' },
|
||||||
},
|
},
|
||||||
enabled = function()
|
enabled = function()
|
||||||
return vim.api.nvim_buf_get_option(0, "buftype") ~= "prompt"
|
return vim.api.nvim_buf_get_option(0, 'buftype') ~= 'prompt'
|
||||||
or vim.api.nvim_buf_get_option(0, 'filetype') == 'dap-repl'
|
or vim.api.nvim_buf_get_option(0, 'filetype') == 'dap-repl'
|
||||||
or vim.api.nvim_buf_get_option(0, 'filetype') == 'dapui_watches'
|
or vim.api.nvim_buf_get_option(0, 'filetype') == 'dapui_watches'
|
||||||
or vim.api.nvim_buf_get_option(0, 'filetype') == 'dapui_hover'
|
or vim.api.nvim_buf_get_option(0, 'filetype') == 'dapui_hover'
|
||||||
|
@ -9,14 +9,14 @@ return {
|
|||||||
{
|
{
|
||||||
'<c-c>',
|
'<c-c>',
|
||||||
'<Plug>(comment_toggle_linewise_current)',
|
'<Plug>(comment_toggle_linewise_current)',
|
||||||
desc= 'Toggle comment'
|
desc = 'Toggle comment'
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
'<c-c>',
|
'<c-c>',
|
||||||
'<Plug>(comment_toggle_linewise_visual)gv',
|
'<Plug>(comment_toggle_linewise_visual)gv',
|
||||||
mode = 'v',
|
mode = 'v',
|
||||||
desc= 'Toggle comment'
|
desc = 'Toggle comment'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,12 +77,12 @@ return {
|
|||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local dap = require('dap')
|
local dap = require('dap')
|
||||||
vim.fn.sign_define('DapBreakpoint', {text='🛑', texthl='', linehl='', numhl=''})
|
vim.fn.sign_define('DapBreakpoint', { text = '🛑', texthl = '', linehl = '', numhl = '' })
|
||||||
require("cmp_dap").is_dap_buffer()
|
require('cmp_dap').is_dap_buffer()
|
||||||
|
|
||||||
|
|
||||||
-- make sure we can exit the terminal with esc
|
-- make sure we can exit the terminal with esc
|
||||||
vim.api.nvim_create_autocmd({ "TermOpen" }, {
|
vim.api.nvim_create_autocmd({ 'TermOpen' }, {
|
||||||
pattern = { '*dap-terminal*' },
|
pattern = { '*dap-terminal*' },
|
||||||
callback = function()
|
callback = function()
|
||||||
local opts = { noremap = true }
|
local opts = { noremap = true }
|
||||||
@ -99,13 +99,13 @@ return {
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function getPythonEnv()
|
local function getPythonEnv()
|
||||||
local venv = os.getenv("VIRTUAL_ENV")
|
local venv = os.getenv('VIRTUAL_ENV')
|
||||||
if venv ~= nil then
|
if venv ~= nil then
|
||||||
return string.format("%s/%s", venv, getVenvSuffix())
|
return string.format('%s/%s', venv, getVenvSuffix())
|
||||||
end
|
end
|
||||||
local conda = os.getenv("CONDA_PREFIX")
|
local conda = os.getenv('CONDA_PREFIX')
|
||||||
if conda ~= nil then
|
if conda ~= nil then
|
||||||
return string.format("%s/%s", conda, 'python.exe')
|
return string.format('%s/%s', conda, 'python.exe')
|
||||||
end
|
end
|
||||||
|
|
||||||
local cwd = vim.fn.getcwd()
|
local cwd = vim.fn.getcwd()
|
||||||
@ -144,15 +144,15 @@ return {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
local dapui = require("dapui")
|
local dapui = require('dapui')
|
||||||
dapui.setup()
|
dapui.setup()
|
||||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
dap.listeners.after.event_initialized['dapui_config'] = function()
|
||||||
dapui.open({})
|
dapui.open({})
|
||||||
end
|
end
|
||||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
dap.listeners.before.event_terminated['dapui_config'] = function()
|
||||||
dapui.close({})
|
dapui.close({})
|
||||||
end
|
end
|
||||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
dap.listeners.before.event_exited['dapui_config'] = function()
|
||||||
dapui.close({})
|
dapui.close({})
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -160,9 +160,9 @@ return {
|
|||||||
{
|
{
|
||||||
type = 'python';
|
type = 'python';
|
||||||
request = 'launch';
|
request = 'launch';
|
||||||
name = "Launch file with venv";
|
name = 'Launch file with venv';
|
||||||
justMyCode = false;
|
justMyCode = false;
|
||||||
program = "${file}";
|
program = '${file}';
|
||||||
cwd = vim.fn.getcwd();
|
cwd = vim.fn.getcwd();
|
||||||
pythonPath = getPythonEnv
|
pythonPath = getPythonEnv
|
||||||
},
|
},
|
||||||
@ -182,7 +182,7 @@ return {
|
|||||||
-- CPP
|
-- CPP
|
||||||
dap.adapters.codelldb = {
|
dap.adapters.codelldb = {
|
||||||
type = 'server',
|
type = 'server',
|
||||||
port = "${port}",
|
port = '${port}',
|
||||||
executable = {
|
executable = {
|
||||||
-- CHANGE THIS to your path!
|
-- CHANGE THIS to your path!
|
||||||
command = masonpath .. '/bin/codelldb.cmd',
|
command = masonpath .. '/bin/codelldb.cmd',
|
||||||
@ -207,9 +207,9 @@ return {
|
|||||||
|
|
||||||
dap.configurations.cpp = {
|
dap.configurations.cpp = {
|
||||||
{
|
{
|
||||||
name = "Launch codelldb",
|
name = 'Launch codelldb',
|
||||||
type = "codelldb",
|
type = 'codelldb',
|
||||||
request = "launch",
|
request = 'launch',
|
||||||
program = function()
|
program = function()
|
||||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build_nvim/', 'file')
|
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build_nvim/', 'file')
|
||||||
end,
|
end,
|
||||||
|
@ -3,7 +3,7 @@ return {
|
|||||||
priority = 1000,
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
local colors = require('gruvbox.colors')
|
local colors = require('gruvbox.colors')
|
||||||
vim.g.gruvbox_flat_style = "dark"
|
vim.g.gruvbox_flat_style = 'dark'
|
||||||
vim.g.gruvbox_colors = {
|
vim.g.gruvbox_colors = {
|
||||||
bg_search = 'purple',
|
bg_search = 'purple',
|
||||||
fg_search = 'black',
|
fg_search = 'black',
|
||||||
|
@ -11,7 +11,7 @@ return {
|
|||||||
'LazyGit',
|
'LazyGit',
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require("telescope").load_extension("lazygit")
|
require('telescope').load_extension('lazygit')
|
||||||
end,
|
end,
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
|
@ -22,37 +22,37 @@ return {
|
|||||||
|
|
||||||
vim.api.nvim_set_hl(
|
vim.api.nvim_set_hl(
|
||||||
0,
|
0,
|
||||||
"LspReferenceText",
|
'LspReferenceText',
|
||||||
{ bold = true,
|
{ bold = true,
|
||||||
ctermbg = 'red',
|
ctermbg = 'red',
|
||||||
bg = "#5a524c" }
|
bg = '#5a524c' }
|
||||||
)
|
)
|
||||||
vim.api.nvim_set_hl(
|
vim.api.nvim_set_hl(
|
||||||
0,
|
0,
|
||||||
"LspReferenceRead",
|
'LspReferenceRead',
|
||||||
{ bold = true,
|
{ bold = true,
|
||||||
ctermbg = 'red',
|
ctermbg = 'red',
|
||||||
bg = 'DarkGreen' }
|
bg = 'DarkGreen' }
|
||||||
)
|
)
|
||||||
vim.api.nvim_set_hl(
|
vim.api.nvim_set_hl(
|
||||||
0,
|
0,
|
||||||
"LspReferenceWrite",
|
'LspReferenceWrite',
|
||||||
{ bold = true,
|
{ bold = true,
|
||||||
ctermbg = 'red',
|
ctermbg = 'red',
|
||||||
bg = 'DarkRed' }
|
bg = 'DarkRed' }
|
||||||
)
|
)
|
||||||
local diagnostics = {
|
local diagnostics = {
|
||||||
Error = " ",
|
Error = ' ',
|
||||||
Warning = " ",
|
Warning = ' ',
|
||||||
Information = " ",
|
Information = ' ',
|
||||||
Question = " ",
|
Question = ' ',
|
||||||
Hint = " ",
|
Hint = ' ',
|
||||||
}
|
}
|
||||||
local signs = {
|
local signs = {
|
||||||
{ name = "DiagnosticSignError", text = diagnostics.Error },
|
{ name = 'DiagnosticSignError', text = diagnostics.Error },
|
||||||
{ name = "DiagnosticSignWarn", text = diagnostics.Warning },
|
{ name = 'DiagnosticSignWarn', text = diagnostics.Warning },
|
||||||
{ name = "DiagnosticSignHint", text = diagnostics.Hint },
|
{ name = 'DiagnosticSignHint', text = diagnostics.Hint },
|
||||||
{ name = "DiagnosticSignInfo", text = diagnostics.Information },
|
{ name = 'DiagnosticSignInfo', text = diagnostics.Information },
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, sign in ipairs(signs) do
|
for _, sign in ipairs(signs) do
|
||||||
@ -129,22 +129,22 @@ return {
|
|||||||
|
|
||||||
-- Set autocommands conditional on server_capabilities
|
-- Set autocommands conditional on server_capabilities
|
||||||
if client.server_capabilities.documentHighlightProvider then
|
if client.server_capabilities.documentHighlightProvider then
|
||||||
local group = vim.api.nvim_create_augroup("lsp_document_highlight", { clear = false })
|
local group = vim.api.nvim_create_augroup('lsp_document_highlight', { clear = false })
|
||||||
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.lsp.buf.document_highlight()
|
vim.lsp.buf.document_highlight()
|
||||||
end,
|
end,
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
group = group,
|
group = group,
|
||||||
desc = "Document Highlight",
|
desc = 'Document Highlight',
|
||||||
})
|
})
|
||||||
vim.api.nvim_create_autocmd("CursorMoved", {
|
vim.api.nvim_create_autocmd('CursorMoved', {
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.lsp.buf.clear_references()
|
vim.lsp.buf.clear_references()
|
||||||
end,
|
end,
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
group = group,
|
group = group,
|
||||||
desc = "Clear All the References",
|
desc = 'Clear All the References',
|
||||||
})
|
})
|
||||||
vim.api.nvim_create_autocmd({ 'LspDetach' }, {
|
vim.api.nvim_create_autocmd({ 'LspDetach' }, {
|
||||||
group = group,
|
group = group,
|
||||||
@ -185,8 +185,8 @@ return {
|
|||||||
|
|
||||||
local clangd_capabilities = capabilities
|
local clangd_capabilities = capabilities
|
||||||
clangd_capabilities.textDocument.semanticHighlighting = true
|
clangd_capabilities.textDocument.semanticHighlighting = true
|
||||||
clangd_capabilities.offsetEncoding = { "utf-16" }
|
clangd_capabilities.offsetEncoding = { 'utf-16' }
|
||||||
require("clangd_extensions").setup {
|
require('clangd_extensions').setup {
|
||||||
server = {
|
server = {
|
||||||
capabilities = clangd_capabilities,
|
capabilities = clangd_capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
@ -211,13 +211,6 @@ return {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
-- require('clangd_extensions').setup({
|
|
||||||
-- server = {
|
|
||||||
-- on_attach = on_attach,
|
|
||||||
-- capabilities = capabilities,
|
|
||||||
-- cmd = { 'clangd', '--compile-commands-dir=build_nvim' },
|
|
||||||
-- },
|
|
||||||
-- })
|
|
||||||
|
|
||||||
lspconfig['jsonls'].setup {
|
lspconfig['jsonls'].setup {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
@ -256,7 +249,7 @@ return {
|
|||||||
defaultConfig = {
|
defaultConfig = {
|
||||||
indent_style = 'space',
|
indent_style = 'space',
|
||||||
indent_size = '2',
|
indent_size = '2',
|
||||||
quote_style = 'single'
|
quote_style = 'single',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -300,10 +293,10 @@ return {
|
|||||||
virtual_text = false,
|
virtual_text = false,
|
||||||
signs = true,
|
signs = true,
|
||||||
float = {
|
float = {
|
||||||
border = "single",
|
border = 'single',
|
||||||
format = function(diagnostic)
|
format = function(diagnostic)
|
||||||
return string.format(
|
return string.format(
|
||||||
"%s (%s) [%s]",
|
'%s (%s) [%s]',
|
||||||
diagnostic.message,
|
diagnostic.message,
|
||||||
diagnostic.source,
|
diagnostic.source,
|
||||||
diagnostic.code or diagnostic.user_data.lsp.code
|
diagnostic.code or diagnostic.user_data.lsp.code
|
||||||
|
@ -56,7 +56,7 @@ return {
|
|||||||
}
|
}
|
||||||
|
|
||||||
require('luasnip.loaders.from_vscode').lazy_load()
|
require('luasnip.loaders.from_vscode').lazy_load()
|
||||||
require('luasnip.loaders.from_vscode').lazy_load({ paths = { "./my-snippets" } })
|
require('luasnip.loaders.from_vscode').lazy_load({ paths = { './my-snippets' } })
|
||||||
end,
|
end,
|
||||||
dependencies =
|
dependencies =
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
return {
|
return {
|
||||||
"AckslD/nvim-neoclip.lua",
|
'AckslD/nvim-neoclip.lua',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{ 'kkharji/sqlite.lua', module = 'sqlite' },
|
{ 'kkharji/sqlite.lua', module = 'sqlite' },
|
||||||
-- { 'nvim-telescope/telescope.nvim' },
|
-- { 'nvim-telescope/telescope.nvim' },
|
||||||
@ -8,8 +8,8 @@ return {
|
|||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
'[',
|
'[',
|
||||||
function ()
|
function()
|
||||||
require('telescope').extensions.neoclip.default({initial_mode='normal'})
|
require('telescope').extensions.neoclip.default({ initial_mode = 'normal' })
|
||||||
end,
|
end,
|
||||||
desc = 'NeoClip'
|
desc = 'NeoClip'
|
||||||
}
|
}
|
||||||
|
@ -7,13 +7,13 @@ return {
|
|||||||
'nvim-neotest/neotest-python'
|
'nvim-neotest/neotest-python'
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require("neotest").setup({
|
require('neotest').setup({
|
||||||
adapters = {
|
adapters = {
|
||||||
require("neotest-python")({
|
require('neotest-python')({
|
||||||
dap = {
|
dap = {
|
||||||
justMyCode = false
|
justMyCode = false
|
||||||
},
|
},
|
||||||
args = { "--log-level", "DEBUG" },
|
args = { '--log-level', 'DEBUG' },
|
||||||
runner = 'pytest',
|
runner = 'pytest',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -23,14 +23,14 @@ return {
|
|||||||
{
|
{
|
||||||
'<F3>',
|
'<F3>',
|
||||||
function()
|
function()
|
||||||
require("neotest").run.run()
|
require('neotest').run.run()
|
||||||
end,
|
end,
|
||||||
desc = 'Run nearest test'
|
desc = 'Run nearest test'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'<S-F3>',
|
'<S-F3>',
|
||||||
function()
|
function()
|
||||||
require("neotest").run.run({ strategy = "dap" })
|
require('neotest').run.run({ strategy = 'dap' })
|
||||||
end,
|
end,
|
||||||
desc = 'Run nearest test'
|
desc = 'Run nearest test'
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ return {
|
|||||||
'stevearc/overseer.nvim',
|
'stevearc/overseer.nvim',
|
||||||
config = function()
|
config = function()
|
||||||
require('overseer').setup({
|
require('overseer').setup({
|
||||||
templates = { "builtin", "user.cmake.cmake" },
|
templates = { 'builtin', 'user.cmake.cmake' },
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
keys = {
|
keys = {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
return {
|
return {
|
||||||
'ahmedkhalf/project.nvim',
|
'ahmedkhalf/project.nvim',
|
||||||
config = function()
|
config = function()
|
||||||
require("project_nvim").setup(
|
require('project_nvim').setup(
|
||||||
{
|
{
|
||||||
silent_chdir = true,
|
silent_chdir = true,
|
||||||
ignore_lsp = { 'null-ls', 'cmake' },
|
ignore_lsp = { 'null-ls', 'cmake' },
|
||||||
patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json", "build_nvim", "real_path.txt" },
|
patterns = { '.git', '_darcs', '.hg', '.bzr', '.svn', 'Makefile', 'package.json', 'build_nvim', 'real_path.txt' },
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
@ -14,19 +14,19 @@ return {
|
|||||||
'nvim-telescope/telescope-ui-select.nvim',
|
'nvim-telescope/telescope-ui-select.nvim',
|
||||||
'ahmedkhalf/project.nvim',
|
'ahmedkhalf/project.nvim',
|
||||||
},
|
},
|
||||||
cmd = { "Telescope" },
|
cmd = { 'Telescope' },
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
'<leader>f',
|
'<leader>f',
|
||||||
function()
|
function()
|
||||||
require("telescope.builtin").find_files({ no_ignore = true, hidden = true })
|
require('telescope.builtin').find_files({ no_ignore = true, hidden = true })
|
||||||
end,
|
end,
|
||||||
desc = 'Find file',
|
desc = 'Find file',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'<leader>c',
|
'<leader>c',
|
||||||
function()
|
function()
|
||||||
require("telescope.builtin").commands()
|
require('telescope.builtin').commands()
|
||||||
end,
|
end,
|
||||||
desc = 'Telescope commands',
|
desc = 'Telescope commands',
|
||||||
},
|
},
|
||||||
@ -40,56 +40,56 @@ return {
|
|||||||
{
|
{
|
||||||
'<leader>o',
|
'<leader>o',
|
||||||
function()
|
function()
|
||||||
require("telescope.builtin").oldfiles()
|
require('telescope.builtin').oldfiles()
|
||||||
end,
|
end,
|
||||||
desc = 'Find old files',
|
desc = 'Find old files',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'<leader>h',
|
'<leader>h',
|
||||||
function()
|
function()
|
||||||
require("telescope.builtin").command_history()
|
require('telescope.builtin').command_history()
|
||||||
end,
|
end,
|
||||||
desc = 'Open command history',
|
desc = 'Open command history',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'<leader>b',
|
'<leader>b',
|
||||||
function()
|
function()
|
||||||
require("telescope.builtin").buffers()
|
require('telescope.builtin').buffers()
|
||||||
end,
|
end,
|
||||||
desc = 'Select buffer',
|
desc = 'Select buffer',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'<leader>q',
|
'<leader>q',
|
||||||
function()
|
function()
|
||||||
require("telescope.builtin").quickfix()
|
require('telescope.builtin').quickfix()
|
||||||
end,
|
end,
|
||||||
desc = 'Quickfix list with telescope',
|
desc = 'Quickfix list with telescope',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'<leader>l',
|
'<leader>l',
|
||||||
function()
|
function()
|
||||||
require("telescope.builtin").live_grep()
|
require('telescope.builtin').live_grep()
|
||||||
end,
|
end,
|
||||||
desc = 'Search in project',
|
desc = 'Search in project',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'<leader>j',
|
'<leader>j',
|
||||||
function()
|
function()
|
||||||
require("telescope.builtin").jumplist()
|
require('telescope.builtin').jumplist()
|
||||||
end,
|
end,
|
||||||
desc = 'Open jumplist',
|
desc = 'Open jumplist',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'<c-f>',
|
'<c-f>',
|
||||||
function()
|
function()
|
||||||
require("telescope.builtin").current_buffer_fuzzy_find()
|
require('telescope.builtin').current_buffer_fuzzy_find()
|
||||||
end,
|
end,
|
||||||
desc = 'Find in buffer',
|
desc = 'Find in buffer',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'<leader>d',
|
'<leader>d',
|
||||||
function()
|
function()
|
||||||
require("telescope.builtin").grep_string()
|
require('telescope.builtin').grep_string()
|
||||||
end,
|
end,
|
||||||
desc = 'Find in workspace',
|
desc = 'Find in workspace',
|
||||||
},
|
},
|
||||||
@ -113,21 +113,21 @@ return {
|
|||||||
|
|
||||||
Project_files = function()
|
Project_files = function()
|
||||||
local opts = {} -- define here if you want to define something
|
local opts = {} -- define here if you want to define something
|
||||||
local ok = pcall(require "telescope.builtin".git_files, opts)
|
local ok = pcall(require 'telescope.builtin'.git_files, opts)
|
||||||
if not ok then require "telescope.builtin".find_files(opts) end
|
if not ok then require 'telescope.builtin'.find_files(opts) end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local telescopeConfig = require("telescope.config")
|
local telescopeConfig = require('telescope.config')
|
||||||
|
|
||||||
-- Clone the default Telescope configuration
|
-- Clone the default Telescope configuration
|
||||||
local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) }
|
local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) }
|
||||||
|
|
||||||
-- I want to search in hidden/dot files.
|
-- I want to search in hidden/dot files.
|
||||||
table.insert(vimgrep_arguments, "--hidden")
|
table.insert(vimgrep_arguments, '--hidden')
|
||||||
-- I don't want to search in the `.git` directory.
|
-- I don't want to search in the `.git` directory.
|
||||||
table.insert(vimgrep_arguments, "--glob")
|
table.insert(vimgrep_arguments, '--glob')
|
||||||
table.insert(vimgrep_arguments, "!**/.git/*")
|
table.insert(vimgrep_arguments, '!**/.git/*')
|
||||||
|
|
||||||
require('telescope').setup({
|
require('telescope').setup({
|
||||||
defaults = {
|
defaults = {
|
||||||
@ -160,7 +160,7 @@ return {
|
|||||||
theme = 'ivy',
|
theme = 'ivy',
|
||||||
previewer = false,
|
previewer = false,
|
||||||
-- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d.
|
-- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d.
|
||||||
find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" },
|
find_command = { 'rg', '--files', '--hidden', '--glob', '!**/.git/*' },
|
||||||
},
|
},
|
||||||
oldfiles = {
|
oldfiles = {
|
||||||
theme = 'ivy',
|
theme = 'ivy',
|
||||||
@ -176,14 +176,14 @@ return {
|
|||||||
lsp_dynamic_workspace_symbols = {},
|
lsp_dynamic_workspace_symbols = {},
|
||||||
},
|
},
|
||||||
extensions = {
|
extensions = {
|
||||||
["ui-select"] = {
|
['ui-select'] = {
|
||||||
require("telescope.themes").get_dropdown {
|
require('telescope.themes').get_dropdown {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
require("telescope").load_extension("ui-select")
|
require('telescope').load_extension('ui-select')
|
||||||
require('telescope').load_extension('fzf')
|
require('telescope').load_extension('fzf')
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
@ -26,25 +26,24 @@ return {
|
|||||||
|
|
||||||
keymaps = {
|
keymaps = {
|
||||||
-- You can use the capture groups defined in textobjects.scm
|
-- You can use the capture groups defined in textobjects.scm
|
||||||
["af"] = "@function.outer",
|
['af'] = '@function.outer',
|
||||||
["if"] = "@function.inner",
|
['if'] = '@function.inner',
|
||||||
["ac"] = "@class.outer",
|
['ac'] = '@class.outer',
|
||||||
["ic"] = "@class.inner",
|
['ic'] = '@class.inner',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
lsp_interop = {
|
lsp_interop = {
|
||||||
enable = true,
|
enable = true,
|
||||||
border = 'none',
|
border = 'none',
|
||||||
peek_definition_code = {
|
peek_definition_code = {
|
||||||
["<leader>df"] = "@function.outer",
|
['<leader>df'] = '@function.outer',
|
||||||
["<leader>dF"] = "@class.outer",
|
['<leader>dF'] = '@class.outer',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
local parser = require('nvim-treesitter.parsers').filetype_to_parsername
|
local parser = require('nvim-treesitter.parsers').filetype_to_parsername
|
||||||
parser.groovy = 'java' -- the someft filetype will use the python parser and queries.
|
parser.groovy = 'java' -- the someft filetype will use the python parser and queries.
|
||||||
require("nvim-treesitter.install").prefer_git = true
|
require('nvim-treesitter.install').prefer_git = true
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user