From fbdad999cd9131eac3efb3325fa6135665ee51b1 Mon Sep 17 00:00:00 2001 From: Oliver Hartmann Date: Wed, 16 Mar 2022 21:04:13 +0100 Subject: [PATCH] gitsigns, comment, cmake --- init.lua | 34 ---------------------------------- lua/my_plugins.lua | 13 ++++++++++--- lua/setup/cmake.lua | 14 ++++++++++++++ lua/setup/comment.lua | 10 ++++++++++ lua/setup/gitsigns.lua | 9 +++++++++ 5 files changed, 43 insertions(+), 37 deletions(-) create mode 100644 lua/setup/cmake.lua create mode 100644 lua/setup/comment.lua create mode 100644 lua/setup/gitsigns.lua diff --git a/init.lua b/init.lua index 6fe7b64..77bb715 100644 --- a/init.lua +++ b/init.lua @@ -9,40 +9,6 @@ require('my_plugins') require('my_keymappings') require('my_options') require("my_autocommands") --------------------- GITSIGNS ------------------------------ -require('gitsigns').setup({ - current_line_blame = true, - current_line_blame_opts = { - virt_text = true, - virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' - delay = 1000, - ignore_whitespace = false, - }, -}) --------------------- COMMENTED ----------------------------- -require('Comment').setup({ - toggler = { - ---line-comment toggle - line = 'cc', - }, - opleader = { - ---line-comment opfunc mapping - line = 'c', - }, -}) --------------------- CMAKE --------------------------------- --- require('telescope').load_extension('cmake') -require('cmake').setup({ - parameters_file = 'neovim.json', -- JSON file to store information about selected target, run arguments and build type. - build_dir = '{cwd}/build_nvim', -- Build directory. The expressions `{cwd}`, `{os}` and `{build_type}` will be expanded with the corresponding text values. -}) -utils.map('n', '', ':CMake build:copen') - --- msbuild errorformat -opt.errorformat:append("\\ %#%f(%l\\\\\\,%c):\\ %m") --- cl.exe errorformat --- o.errorformat:append('\ %#%f(%l) : %#%t%[A-z]%# %m') - -------------------- LUALINE ------------------------------- require('lualine').setup { options = {theme = 'gruvbox-material'}, diff --git a/lua/my_plugins.lua b/lua/my_plugins.lua index ce16612..a38d6e4 100644 --- a/lua/my_plugins.lua +++ b/lua/my_plugins.lua @@ -46,13 +46,19 @@ return require('packer').startup(function() use {'ellisonleao/gruvbox.nvim'} use {'lukas-reineke/indent-blankline.nvim'} use {'nvim-lua/plenary.nvim'} - use {'lewis6991/gitsigns.nvim'} + use { + 'lewis6991/gitsigns.nvim', + config = get_setup("gitsigns") + } use { 'kyazdani42/nvim-tree.lua', requires = 'kyazdani42/nvim-web-devicons', config = get_setup("nvim-tree") } - use{'numToStr/Comment.nvim'} + use{ + 'numToStr/Comment.nvim', + config = get_setup("comment") + } use { 'hrsh7th/nvim-cmp', requires = { @@ -76,7 +82,8 @@ return require('packer').startup(function() use {'rafamadriz/friendly-snippets'} use {'onsails/lspkind-nvim'} use {'Shatur/neovim-cmake', - requires = {'mfussenegger/nvim-dap'} + requires = {'mfussenegger/nvim-dap'}, + config = get_setup("cmake") } use { 'hoob3rt/lualine.nvim', diff --git a/lua/setup/cmake.lua b/lua/setup/cmake.lua new file mode 100644 index 0000000..ca13350 --- /dev/null +++ b/lua/setup/cmake.lua @@ -0,0 +1,14 @@ +local opt = vim.opt -- to set options +local utils = require('utils') +-- require('telescope').load_extension('cmake') +require('cmake').setup({ + parameters_file = 'neovim.json', -- JSON file to store information about selected target, run arguments and build type. + build_dir = '{cwd}/build_nvim', -- Build directory. The expressions `{cwd}`, `{os}` and `{build_type}` will be expanded with the corresponding text values. +}) +utils.map('n', '', ':CMake build:copen') + +-- msbuild errorformat +opt.errorformat:append("\\ %#%f(%l\\\\\\,%c):\\ %m") +-- cl.exe errorformat +-- o.errorformat:append('\ %#%f(%l) : %#%t%[A-z]%# %m') + diff --git a/lua/setup/comment.lua b/lua/setup/comment.lua new file mode 100644 index 0000000..36c2d79 --- /dev/null +++ b/lua/setup/comment.lua @@ -0,0 +1,10 @@ +require('Comment').setup({ + toggler = { + ---line-comment toggle + line = 'cc', + }, + opleader = { + ---line-comment opfunc mapping + line = 'c', + }, +}) diff --git a/lua/setup/gitsigns.lua b/lua/setup/gitsigns.lua new file mode 100644 index 0000000..acac0c9 --- /dev/null +++ b/lua/setup/gitsigns.lua @@ -0,0 +1,9 @@ +require('gitsigns').setup({ + current_line_blame = true, + current_line_blame_opts = { + virt_text = true, + virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' + delay = 1000, + ignore_whitespace = false, + }, +})