diff --git a/lua/config/options.lua b/lua/config/options.lua index e3c913a..98d726d 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -1,76 +1,77 @@ - -vim.cmd('filetype plugin indent on') -vim.cmd('language en_US.utf-8') - -local opt = vim.opt -local indent = 2 -opt.termguicolors = true -- Enable colors in terminal -opt.hlsearch = true --Set highlight on search -opt.number = true --Make line numbers default -opt.relativenumber = false --Make relative number default -opt.mouse = 'a' --Enable mouse mode -opt.breakindent = true --Enable break indent -opt.undofile = true --Save undo history -opt.ignorecase = true --Case insensitive searching unless /C or capital in search -opt.smartcase = true -- Smart case -opt.updatetime = 300 --Decrease update time -opt.signcolumn = 'yes' -- Always show sign column -opt.timeoutlen = 300 -- Time in milliseconds to wait for a mapped sequence to complete. -opt.ttimeoutlen = 10 -opt.showmode = false -- Do not need to show the mode. We use the statusline instead. -opt.scrolloff = 999 -- Lines of context -opt.joinspaces = false -- No double spaces with join after a dot -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.list = true -opt.hidden= true -opt.scrolloff= 4 -opt.shiftround= true -opt.relativenumber= false -opt.splitbelow= true -opt.splitright= true -opt.wildmode= 'longest:full,full' -opt.splitbelow= true -opt.splitright= true -opt.shiftwidth = indent -opt.tabstop = indent -if vim.fn.has("wsl") == 1 then - vim.g.clipboard = { - name = 'WslClipboard', - copy = { - ['+'] = 'clip.exe', - ['*'] = 'clip.exe', - }, - 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", ""))', - }, - 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 -elseif vim.loop.os_uname().sysname == 'Linux' then - opt.guifont= 'JetBrainsMono Nerd Font Mono:h7' -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 -end -opt.swapfile= false -opt.backup= false -opt.spelllang= 'en,de' -opt.completeopt= 'menu,menuone,noselect' -opt.expandtab= true -opt.smartindent= true -opt.title = true -opt.titlestring = '%{getcwd()} - %t' -opt.laststatus = 3 -- for lualine - --- go to previous/next line with h,l,left arrow and right arrow --- when cursor reaches end/beginning of line --- opt.whichwrap:append('<>[]hl') - --- disable nvim intro -opt.shortmess:append('sI') - --- Treesitter based folding -opt.foldlevel = 20 -opt.foldmethod = 'expr' -opt.foldexpr = 'nvim_treesitter#foldexpr()' +vim.cmd('filetype plugin indent on') +vim.cmd('language en_US.utf-8') + +local opt = vim.opt +local indent = 2 +opt.termguicolors = true -- Enable colors in terminal +opt.hlsearch = true --Set highlight on search +opt.number = true --Make line numbers default +opt.relativenumber = false --Make relative number default +opt.mouse = 'a' --Enable mouse mode +opt.breakindent = true --Enable break indent +opt.undofile = true --Save undo history +opt.ignorecase = true --Case insensitive searching unless /C or capital in search +opt.smartcase = true -- Smart case +opt.updatetime = 300 --Decrease update time +opt.signcolumn = 'yes' -- Always show sign column +opt.timeoutlen = 300 -- Time in milliseconds to wait for a mapped sequence to complete. +opt.ttimeoutlen = 10 +opt.showmode = false -- Do not need to show the mode. We use the statusline instead. +opt.scrolloff = 999 -- Lines of context +opt.joinspaces = false -- No double spaces with join after a dot +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.list = true +opt.hidden = true +opt.scrolloff = 4 +opt.shiftround = true +opt.relativenumber = false +opt.splitbelow = true +opt.splitright = true +opt.wildmode = 'longest:full,full' +opt.splitbelow = true +opt.splitright = true +opt.shiftwidth = indent +opt.tabstop = indent +if vim.fn.has('wsl') == 1 then + vim.g.clipboard = { + name = 'WslClipboard', + copy = { + ['+'] = 'clip.exe', + ['*'] = 'clip.exe', + }, + 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", ""))', + }, + 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 + +elseif vim.loop.os_uname().sysname == 'Linux' then + opt.guifont = 'JetBrainsMono Nerd Font Mono:h7' +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 +end +opt.swapfile = false +opt.backup = false +opt.spelllang = 'en,de' +opt.completeopt = 'menu,menuone,noselect' +opt.expandtab = true +opt.smartindent = true +opt.title = true +opt.titlestring = '%{getcwd()} - %t' +opt.laststatus = 3 -- for lualine + +-- go to previous/next line with h,l,left arrow and right arrow +-- when cursor reaches end/beginning of line +-- opt.whichwrap:append('<>[]hl') + +-- disable nvim intro +opt.shortmess:append('sI') + +-- Treesitter based folding +opt.foldlevel = 20 +opt.foldmethod = 'expr' +opt.foldexpr = 'nvim_treesitter#foldexpr()' +opt.foldexpr = 'nvim_treesitter#foldexpr()' diff --git a/lua/my_autocommands.lua b/lua/my_autocommands.lua index b4d0c5b..b2213d6 100644 --- a/lua/my_autocommands.lua +++ b/lua/my_autocommands.lua @@ -38,14 +38,14 @@ api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, { group = fileGrp, }) api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, { - pattern = { 'doskey'}, + pattern = { 'doskey' }, callback = function() vim.bo.filetype = 'dosini' end, group = fileGrp, }) api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, { - pattern = { '.clangd', '.clang-tidy'}, + pattern = { '.clangd', '.clang-tidy' }, callback = function() vim.bo.filetype = 'yaml' end, @@ -62,7 +62,8 @@ api.nvim_create_autocmd({ 'FocusLost' }, { command = [[wshada]] }) -- ) -- 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" api.nvim_create_autocmd( @@ -82,4 +83,4 @@ api.nvim_create_autocmd( api.nvim_create_autocmd('BufEnter', { command = [[set formatoptions-=cro]] }) -- Keep window ratio when resize -api.nvim_create_autocmd('VimResized', {command = [[wincmd =]]}) +api.nvim_create_autocmd('VimResized', { command = [[wincmd =]] }) diff --git a/lua/my_keymappings.lua b/lua/my_keymappings.lua index 31b0909..8dfb83f 100644 --- a/lua/my_keymappings.lua +++ b/lua/my_keymappings.lua @@ -26,7 +26,7 @@ vim.keymap.set('x', '>', '>gv') local function hlWord() local current_word = vim.call('expand', '') - vim.fn.setreg('/', "\\<" .. current_word .. "\\>") + vim.fn.setreg('/', '\\<' .. current_word .. '\\>') vim.opt.hlsearch = true end @@ -40,10 +40,10 @@ vim.keymap.set('n', '', ':bd', { desc = 'Close buffer' }) vim.keymap.set('n', 'x', 'za', { desc = 'Toggle fold' }) -vim.keymap.set({'n', 'x'}, 'y', '"+y', { desc='Copy from system clipboard'}) -vim.keymap.set({'n', 'x'}, 'Y', '"+yg_', { desc='Copy from system clipboard'}) -vim.keymap.set({'n', 'x'}, 'p', '"+p', { desc='Paste from system clipboard'}) -vim.keymap.set({'n', 'x'}, 'P', '"+P', { desc='Paste from system clipboard'}) +vim.keymap.set({ 'n', 'x' }, 'y', '"+y', { desc = 'Copy from system clipboard' }) +vim.keymap.set({ 'n', 'x' }, 'Y', '"+yg_', { desc = 'Copy from system clipboard' }) +vim.keymap.set({ 'n', 'x' }, 'p', '"+p', { desc = 'Paste from system clipboard' }) +vim.keymap.set({ 'n', 'x' }, '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('LinuxFont', 'set guifont=JetBrainsMono\\ Nerd\\ Font\\ Mono:h7', {}) diff --git a/lua/my_plugins.lua b/lua/my_plugins.lua deleted file mode 100644 index cd16c7b..0000000 --- a/lua/my_plugins.lua +++ /dev/null @@ -1,268 +0,0 @@ -vim.cmd([[ - augroup packer_user_config - autocmd! - autocmd BufWritePost my_plugins.lua source | 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', 's' }, - { 'n', '' } - } - } - 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', '' }, - { 'n', '' }, - { 'n', '' }, - { 'n', '' }, - { 'n', '' }, - { 'n', '' }, - { 'n', '' }, - { 'n', '' } - }, - -- 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', '' } - }, - module = 'overseer' - } - if packer_bootstrap then - require('packer').sync() - end -end) diff --git a/lua/plugins/aerial.lua b/lua/plugins/aerial.lua index 94f0130..401735b 100644 --- a/lua/plugins/aerial.lua +++ b/lua/plugins/aerial.lua @@ -7,7 +7,7 @@ return { require('aerial').setup({ backends = { 'lsp', 'treesitter', 'markdown' }, layout = { - default_direction = "prefer_left" + default_direction = 'prefer_left' }, filter_kind = false, show_guides = true, @@ -18,7 +18,7 @@ return { keys = { { 's', - function () + function() require('aerial').toggle() end, desc = 'Symbols outline', diff --git a/lua/plugins/cmake-tools.lua b/lua/plugins/cmake-tools.lua index 5857b24..658a20e 100644 --- a/lua/plugins/cmake-tools.lua +++ b/lua/plugins/cmake-tools.lua @@ -1,11 +1,11 @@ return { 'Civitasv/cmake-tools.nvim', config = { - cmake_command = "cmake", - cmake_generate_options = { "-D", "CMAKE_EXPORT_COMPILE_COMMANDS=1", '-G', 'Ninja' }, - cmake_show_console = "always", - cmake_build_directory = "build_nvim", - cmake_dap_configuration = { name = "cpp", type = "codelldb", request = "launch" }, -- dap configuration, optional + cmake_command = 'cmake', + cmake_generate_options = { '-D', 'CMAKE_EXPORT_COMPILE_COMMANDS=1', '-G', 'Ninja' }, + cmake_show_console = 'always', + cmake_build_directory = 'build_nvim', + cmake_dap_configuration = { name = 'cpp', type = 'codelldb', request = 'launch' }, -- dap configuration, optional }, cmd = { 'CMakeGenerate', diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 21f2978..356d524 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -106,7 +106,7 @@ return { -- { name = 'emoji' }, }, 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') == 'dapui_watches' or vim.api.nvim_buf_get_option(0, 'filetype') == 'dapui_hover' diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua index c1eedc9..b90706a 100644 --- a/lua/plugins/comment.lua +++ b/lua/plugins/comment.lua @@ -9,14 +9,14 @@ return { { '', '(comment_toggle_linewise_current)', - desc= 'Toggle comment' + desc = 'Toggle comment' }, { '', '(comment_toggle_linewise_visual)gv', mode = 'v', - desc= 'Toggle comment' + desc = 'Toggle comment' } } } diff --git a/lua/plugins/dap.lua b/lua/plugins/dap.lua index 1983a9b..6e85027 100644 --- a/lua/plugins/dap.lua +++ b/lua/plugins/dap.lua @@ -77,12 +77,12 @@ return { }, config = function() local dap = require('dap') - vim.fn.sign_define('DapBreakpoint', {text='🛑', texthl='', linehl='', numhl=''}) - require("cmp_dap").is_dap_buffer() + vim.fn.sign_define('DapBreakpoint', { text = '🛑', texthl = '', linehl = '', numhl = '' }) + require('cmp_dap').is_dap_buffer() -- make sure we can exit the terminal with esc - vim.api.nvim_create_autocmd({ "TermOpen" }, { + vim.api.nvim_create_autocmd({ 'TermOpen' }, { pattern = { '*dap-terminal*' }, callback = function() local opts = { noremap = true } @@ -99,13 +99,13 @@ return { end local function getPythonEnv() - local venv = os.getenv("VIRTUAL_ENV") + local venv = os.getenv('VIRTUAL_ENV') if venv ~= nil then - return string.format("%s/%s", venv, getVenvSuffix()) + return string.format('%s/%s', venv, getVenvSuffix()) end - local conda = os.getenv("CONDA_PREFIX") + local conda = os.getenv('CONDA_PREFIX') if conda ~= nil then - return string.format("%s/%s", conda, 'python.exe') + return string.format('%s/%s', conda, 'python.exe') end local cwd = vim.fn.getcwd() @@ -144,15 +144,15 @@ return { }; } - local dapui = require("dapui") + local dapui = require('dapui') dapui.setup() - dap.listeners.after.event_initialized["dapui_config"] = function() + dap.listeners.after.event_initialized['dapui_config'] = function() dapui.open({}) end - dap.listeners.before.event_terminated["dapui_config"] = function() + dap.listeners.before.event_terminated['dapui_config'] = function() dapui.close({}) end - dap.listeners.before.event_exited["dapui_config"] = function() + dap.listeners.before.event_exited['dapui_config'] = function() dapui.close({}) end @@ -160,9 +160,9 @@ return { { type = 'python'; request = 'launch'; - name = "Launch file with venv"; + name = 'Launch file with venv'; justMyCode = false; - program = "${file}"; + program = '${file}'; cwd = vim.fn.getcwd(); pythonPath = getPythonEnv }, @@ -182,7 +182,7 @@ return { -- CPP dap.adapters.codelldb = { type = 'server', - port = "${port}", + port = '${port}', executable = { -- CHANGE THIS to your path! command = masonpath .. '/bin/codelldb.cmd', @@ -207,9 +207,9 @@ return { dap.configurations.cpp = { { - name = "Launch codelldb", - type = "codelldb", - request = "launch", + name = 'Launch codelldb', + type = 'codelldb', + request = 'launch', program = function() return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build_nvim/', 'file') end, diff --git a/lua/plugins/gruvbox_flat.lua b/lua/plugins/gruvbox_flat.lua index 8c65c28..fbdcfa5 100644 --- a/lua/plugins/gruvbox_flat.lua +++ b/lua/plugins/gruvbox_flat.lua @@ -3,7 +3,7 @@ return { priority = 1000, config = function() local colors = require('gruvbox.colors') - vim.g.gruvbox_flat_style = "dark" + vim.g.gruvbox_flat_style = 'dark' vim.g.gruvbox_colors = { bg_search = 'purple', fg_search = 'black', diff --git a/lua/plugins/lazygit.lua b/lua/plugins/lazygit.lua index 5ce1e2f..59a9a4e 100644 --- a/lua/plugins/lazygit.lua +++ b/lua/plugins/lazygit.lua @@ -11,7 +11,7 @@ return { 'LazyGit', }, config = function() - require("telescope").load_extension("lazygit") + require('telescope').load_extension('lazygit') end, keys = { { diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 71b0725..cde18c7 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -22,37 +22,37 @@ return { vim.api.nvim_set_hl( 0, - "LspReferenceText", + 'LspReferenceText', { bold = true, ctermbg = 'red', - bg = "#5a524c" } + bg = '#5a524c' } ) vim.api.nvim_set_hl( 0, - "LspReferenceRead", + 'LspReferenceRead', { bold = true, ctermbg = 'red', bg = 'DarkGreen' } ) vim.api.nvim_set_hl( 0, - "LspReferenceWrite", + 'LspReferenceWrite', { bold = true, ctermbg = 'red', bg = 'DarkRed' } ) local diagnostics = { - Error = " ", - Warning = " ", - Information = " ", - Question = " ", - Hint = " ", + Error = ' ', + Warning = ' ', + Information = ' ', + Question = ' ', + Hint = ' ', } local signs = { - { name = "DiagnosticSignError", text = diagnostics.Error }, - { name = "DiagnosticSignWarn", text = diagnostics.Warning }, - { name = "DiagnosticSignHint", text = diagnostics.Hint }, - { name = "DiagnosticSignInfo", text = diagnostics.Information }, + { name = 'DiagnosticSignError', text = diagnostics.Error }, + { name = 'DiagnosticSignWarn', text = diagnostics.Warning }, + { name = 'DiagnosticSignHint', text = diagnostics.Hint }, + { name = 'DiagnosticSignInfo', text = diagnostics.Information }, } for _, sign in ipairs(signs) do @@ -129,22 +129,22 @@ return { -- Set autocommands conditional on server_capabilities if client.server_capabilities.documentHighlightProvider then - local group = vim.api.nvim_create_augroup("lsp_document_highlight", { clear = false }) - vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { + local group = vim.api.nvim_create_augroup('lsp_document_highlight', { clear = false }) + vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { callback = function() vim.lsp.buf.document_highlight() end, buffer = bufnr, group = group, - desc = "Document Highlight", + desc = 'Document Highlight', }) - vim.api.nvim_create_autocmd("CursorMoved", { + vim.api.nvim_create_autocmd('CursorMoved', { callback = function() vim.lsp.buf.clear_references() end, buffer = bufnr, group = group, - desc = "Clear All the References", + desc = 'Clear All the References', }) vim.api.nvim_create_autocmd({ 'LspDetach' }, { group = group, @@ -185,8 +185,8 @@ return { local clangd_capabilities = capabilities clangd_capabilities.textDocument.semanticHighlighting = true - clangd_capabilities.offsetEncoding = { "utf-16" } - require("clangd_extensions").setup { + clangd_capabilities.offsetEncoding = { 'utf-16' } + require('clangd_extensions').setup { server = { capabilities = clangd_capabilities, 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 { capabilities = capabilities, @@ -256,7 +249,7 @@ return { defaultConfig = { indent_style = 'space', indent_size = '2', - quote_style = 'single' + quote_style = 'single', } } }, @@ -300,10 +293,10 @@ return { virtual_text = false, signs = true, float = { - border = "single", + border = 'single', format = function(diagnostic) return string.format( - "%s (%s) [%s]", + '%s (%s) [%s]', diagnostic.message, diagnostic.source, diagnostic.code or diagnostic.user_data.lsp.code diff --git a/lua/plugins/luasnip.lua b/lua/plugins/luasnip.lua index e11aa7f..c8d4a6d 100644 --- a/lua/plugins/luasnip.lua +++ b/lua/plugins/luasnip.lua @@ -56,7 +56,7 @@ return { } 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, dependencies = { diff --git a/lua/plugins/neoclip.lua b/lua/plugins/neoclip.lua index b38b77e..c72f3e9 100644 --- a/lua/plugins/neoclip.lua +++ b/lua/plugins/neoclip.lua @@ -1,5 +1,5 @@ return { - "AckslD/nvim-neoclip.lua", + 'AckslD/nvim-neoclip.lua', dependencies = { { 'kkharji/sqlite.lua', module = 'sqlite' }, -- { 'nvim-telescope/telescope.nvim' }, @@ -8,8 +8,8 @@ return { keys = { { '[', - function () - require('telescope').extensions.neoclip.default({initial_mode='normal'}) + function() + require('telescope').extensions.neoclip.default({ initial_mode = 'normal' }) end, desc = 'NeoClip' } diff --git a/lua/plugins/neotest.lua b/lua/plugins/neotest.lua index aecffc2..f4da010 100644 --- a/lua/plugins/neotest.lua +++ b/lua/plugins/neotest.lua @@ -7,13 +7,13 @@ return { 'nvim-neotest/neotest-python' }, config = function() - require("neotest").setup({ + require('neotest').setup({ adapters = { - require("neotest-python")({ + require('neotest-python')({ dap = { justMyCode = false }, - args = { "--log-level", "DEBUG" }, + args = { '--log-level', 'DEBUG' }, runner = 'pytest', }) } @@ -23,14 +23,14 @@ return { { '', function() - require("neotest").run.run() + require('neotest').run.run() end, desc = 'Run nearest test' }, { '', function() - require("neotest").run.run({ strategy = "dap" }) + require('neotest').run.run({ strategy = 'dap' }) end, desc = 'Run nearest test' } diff --git a/lua/plugins/overseer.lua b/lua/plugins/overseer.lua index 5de82ed..fcefbee 100644 --- a/lua/plugins/overseer.lua +++ b/lua/plugins/overseer.lua @@ -2,7 +2,7 @@ return { 'stevearc/overseer.nvim', config = function() require('overseer').setup({ - templates = { "builtin", "user.cmake.cmake" }, + templates = { 'builtin', 'user.cmake.cmake' }, }) end, keys = { diff --git a/lua/plugins/project.lua b/lua/plugins/project.lua index 1e3abfa..96f614d 100644 --- a/lua/plugins/project.lua +++ b/lua/plugins/project.lua @@ -1,11 +1,11 @@ return { 'ahmedkhalf/project.nvim', config = function() - require("project_nvim").setup( + require('project_nvim').setup( { silent_chdir = true, 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, } diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 27699fb..4a4970f 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -14,19 +14,19 @@ return { 'nvim-telescope/telescope-ui-select.nvim', 'ahmedkhalf/project.nvim', }, - cmd = { "Telescope" }, + cmd = { 'Telescope' }, keys = { { 'f', function() - require("telescope.builtin").find_files({ no_ignore = true, hidden = true }) + require('telescope.builtin').find_files({ no_ignore = true, hidden = true }) end, desc = 'Find file', }, { 'c', function() - require("telescope.builtin").commands() + require('telescope.builtin').commands() end, desc = 'Telescope commands', }, @@ -40,56 +40,56 @@ return { { 'o', function() - require("telescope.builtin").oldfiles() + require('telescope.builtin').oldfiles() end, desc = 'Find old files', }, { 'h', function() - require("telescope.builtin").command_history() + require('telescope.builtin').command_history() end, desc = 'Open command history', }, { 'b', function() - require("telescope.builtin").buffers() + require('telescope.builtin').buffers() end, desc = 'Select buffer', }, { 'q', function() - require("telescope.builtin").quickfix() + require('telescope.builtin').quickfix() end, desc = 'Quickfix list with telescope', }, { 'l', function() - require("telescope.builtin").live_grep() + require('telescope.builtin').live_grep() end, desc = 'Search in project', }, { 'j', function() - require("telescope.builtin").jumplist() + require('telescope.builtin').jumplist() end, desc = 'Open jumplist', }, { '', function() - require("telescope.builtin").current_buffer_fuzzy_find() + require('telescope.builtin').current_buffer_fuzzy_find() end, desc = 'Find in buffer', }, { 'd', function() - require("telescope.builtin").grep_string() + require('telescope.builtin').grep_string() end, desc = 'Find in workspace', }, @@ -113,21 +113,21 @@ return { Project_files = function() local opts = {} -- define here if you want to define something - local ok = pcall(require "telescope.builtin".git_files, opts) - if not ok then require "telescope.builtin".find_files(opts) end + local ok = pcall(require 'telescope.builtin'.git_files, opts) + if not ok then require 'telescope.builtin'.find_files(opts) end end - local telescopeConfig = require("telescope.config") + 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") + table.insert(vimgrep_arguments, '--hidden') -- I don't want to search in the `.git` directory. - table.insert(vimgrep_arguments, "--glob") - table.insert(vimgrep_arguments, "!**/.git/*") + table.insert(vimgrep_arguments, '--glob') + table.insert(vimgrep_arguments, '!**/.git/*') require('telescope').setup({ defaults = { @@ -160,7 +160,7 @@ return { theme = 'ivy', previewer = false, -- `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 = { theme = 'ivy', @@ -176,14 +176,14 @@ return { lsp_dynamic_workspace_symbols = {}, }, extensions = { - ["ui-select"] = { - require("telescope.themes").get_dropdown { + ['ui-select'] = { + require('telescope.themes').get_dropdown { } } } }) - require("telescope").load_extension("ui-select") + require('telescope').load_extension('ui-select') require('telescope').load_extension('fzf') end } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 3b916e4..277b65a 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -26,25 +26,24 @@ return { keymaps = { -- You can use the capture groups defined in textobjects.scm - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ac"] = "@class.outer", - ["ic"] = "@class.inner", + ['af'] = '@function.outer', + ['if'] = '@function.inner', + ['ac'] = '@class.outer', + ['ic'] = '@class.inner', }, }, lsp_interop = { enable = true, border = 'none', peek_definition_code = { - ["df"] = "@function.outer", - ["dF"] = "@class.outer", + ['df'] = '@function.outer', + ['dF'] = '@class.outer', }, }, }, }) local parser = require('nvim-treesitter.parsers').filetype_to_parsername 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 } -