From 1d85841c65f845a0e57d58dff9b23a25ed853ff4 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Thu, 5 Aug 2021 20:35:26 +0200 Subject: [PATCH 1/7] Add mouse event + [RUST] Change rls to rust-analyzer --- configs/nvim/lua/options.lua | 1 + configs/nvim/lua/plugins/lspconfig/rust.lua | 10 +- configs/nvim/plugin/packer_compiled.lua | 149 ++++++++++++++++++++ 3 files changed, 151 insertions(+), 9 deletions(-) create mode 100644 configs/nvim/plugin/packer_compiled.lua diff --git a/configs/nvim/lua/options.lua b/configs/nvim/lua/options.lua index 8ebe9f9..6299a1d 100644 --- a/configs/nvim/lua/options.lua +++ b/configs/nvim/lua/options.lua @@ -21,6 +21,7 @@ local function init() opt.termguicolors = true -- True color support opt.wildmode = {'list', 'longest'} -- Command-line completion mode opt.wrap = false -- Disable line wrap + opt.mouse = 'a' -- Enable mouse for all previous modes end return { diff --git a/configs/nvim/lua/plugins/lspconfig/rust.lua b/configs/nvim/lua/plugins/lspconfig/rust.lua index 3a47569..97572cc 100644 --- a/configs/nvim/lua/plugins/lspconfig/rust.lua +++ b/configs/nvim/lua/plugins/lspconfig/rust.lua @@ -1,13 +1,5 @@ local function init() - require'lspconfig'.rls.setup { - settings = { - rust = { - unstable_features = true, - build_on_save = false, - all_features = true, - }, - }, - } + require'lspconfig'.rust_analyzer.setup{} end return { diff --git a/configs/nvim/plugin/packer_compiled.lua b/configs/nvim/plugin/packer_compiled.lua new file mode 100644 index 0000000..2662fdd --- /dev/null +++ b/configs/nvim/plugin/packer_compiled.lua @@ -0,0 +1,149 @@ +-- Automatically generated packer.nvim plugin loader code + +if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then + vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"') + return +end + +vim.api.nvim_command('packadd packer.nvim') + +local no_errors, error_msg = pcall(function() + + local time + local profile_info + local should_profile = false + if should_profile then + local hrtime = vim.loop.hrtime + profile_info = {} + time = function(chunk, start) + if start then + profile_info[chunk] = hrtime() + else + profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6 + end + end + else + time = function(chunk, start) end + end + +local function save_profiles(threshold) + local sorted_times = {} + for chunk_name, time_taken in pairs(profile_info) do + sorted_times[#sorted_times + 1] = {chunk_name, time_taken} + end + table.sort(sorted_times, function(a, b) return a[2] > b[2] end) + local results = {} + for i, elem in ipairs(sorted_times) do + if not threshold or threshold and elem[2] > threshold then + results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms' + end + end + + _G._packer = _G._packer or {} + _G._packer.profile_output = results +end + +time([[Luarocks path setup]], true) +local package_path_str = "/home/florian/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/florian/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/florian/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/florian/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" +local install_cpath_pattern = "/home/florian/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so" +if not string.find(package.path, package_path_str, 1, true) then + package.path = package.path .. ';' .. package_path_str +end + +if not string.find(package.cpath, install_cpath_pattern, 1, true) then + package.cpath = package.cpath .. ';' .. install_cpath_pattern +end + +time([[Luarocks path setup]], false) +time([[try_loadstring definition]], true) +local function try_loadstring(s, component, name) + local success, result = pcall(loadstring(s)) + if not success then + vim.schedule(function() + vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {}) + end) + end + return result +end + +time([[try_loadstring definition]], false) +time([[Defining packer_plugins]], true) +_G.packer_plugins = { + ["lazygit.nvim"] = { + loaded = true, + path = "/home/florian/.local/share/nvim/site/pack/packer/start/lazygit.nvim" + }, + ["moonlight.nvim"] = { + loaded = true, + path = "/home/florian/.local/share/nvim/site/pack/packer/start/moonlight.nvim" + }, + ["nvim-autopairs"] = { + loaded = true, + path = "/home/florian/.local/share/nvim/site/pack/packer/start/nvim-autopairs" + }, + ["nvim-comment"] = { + loaded = true, + path = "/home/florian/.local/share/nvim/site/pack/packer/start/nvim-comment" + }, + ["nvim-compe"] = { + loaded = true, + path = "/home/florian/.local/share/nvim/site/pack/packer/start/nvim-compe" + }, + ["nvim-lspconfig"] = { + loaded = true, + path = "/home/florian/.local/share/nvim/site/pack/packer/start/nvim-lspconfig" + }, + ["nvim-lspinstall"] = { + loaded = true, + path = "/home/florian/.local/share/nvim/site/pack/packer/start/nvim-lspinstall" + }, + ["nvim-tree.lua"] = { + loaded = true, + path = "/home/florian/.local/share/nvim/site/pack/packer/start/nvim-tree.lua" + }, + ["nvim-treesitter"] = { + loaded = true, + path = "/home/florian/.local/share/nvim/site/pack/packer/start/nvim-treesitter" + }, + ["nvim-web-devicons"] = { + loaded = true, + path = "/home/florian/.local/share/nvim/site/pack/packer/start/nvim-web-devicons" + }, + ["packer.nvim"] = { + loaded = true, + path = "/home/florian/.local/share/nvim/site/pack/packer/start/packer.nvim" + }, + ["plenary.nvim"] = { + loaded = true, + path = "/home/florian/.local/share/nvim/site/pack/packer/start/plenary.nvim" + }, + ["popup.nvim"] = { + loaded = true, + path = "/home/florian/.local/share/nvim/site/pack/packer/start/popup.nvim" + }, + ["telescope.nvim"] = { + loaded = true, + path = "/home/florian/.local/share/nvim/site/pack/packer/start/telescope.nvim" + }, + vim = { + loaded = true, + path = "/home/florian/.local/share/nvim/site/pack/packer/start/vim" + }, + ["vim-gotham"] = { + loaded = true, + path = "/home/florian/.local/share/nvim/site/pack/packer/start/vim-gotham" + }, + ["vim-startify"] = { + loaded = true, + path = "/home/florian/.local/share/nvim/site/pack/packer/start/vim-startify" + } +} + +time([[Defining packer_plugins]], false) +if should_profile then save_profiles() end + +end) + +if not no_errors then + vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None') +end From efffc9da2976d5dd0bada2c69487772f576f9690 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Thu, 5 Aug 2021 20:50:30 +0200 Subject: [PATCH 2/7] Add notify shortcut --- .gitignore | 1 + configs/nvim/lua/plugins/init.lua | 4 +- configs/nvim/lua/plugins/nvim-notify.lua | 7 ++ configs/nvim/plugin/packer_compiled.lua | 149 ----------------------- 4 files changed, 11 insertions(+), 150 deletions(-) create mode 100644 .gitignore create mode 100644 configs/nvim/lua/plugins/nvim-notify.lua delete mode 100644 configs/nvim/plugin/packer_compiled.lua diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6fa2256 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +configs/nvim/plugin/packer_compiled.lua \ No newline at end of file diff --git a/configs/nvim/lua/plugins/init.lua b/configs/nvim/lua/plugins/init.lua index 546000f..e2f5187 100644 --- a/configs/nvim/lua/plugins/init.lua +++ b/configs/nvim/lua/plugins/init.lua @@ -5,6 +5,7 @@ function configure_packages() call_with_helpers(require('plugins.nvim-web-devicons').init) call_with_helpers(require('plugins.nvim-comment').init) call_with_helpers(require('plugins.nvim-autopairs').init) + call_with_helpers(require('plugins.nvim-notify').init) end function install_packages() @@ -22,7 +23,7 @@ function install_packages() -- Telescope project search use { 'nvim-telescope/telescope.nvim', - requires = {{'nvim-lua/popup.nvim'}, {'nvim-lua/plenary.nvim'}} + requires = {{'nvim-lua/popup.nvim'}, {'nvim-lua/plenary.nvim'}, {'nvim-lua/popup.nvim'}} } use 'nvim-treesitter/nvim-treesitter' @@ -31,6 +32,7 @@ function install_packages() use 'kyazdani42/nvim-tree.lua' use 'kdheepak/lazygit.nvim' use 'terrortylor/nvim-comment' + use 'rcarriga/nvim-notify' -- fancy notification use 'mhinz/vim-startify' -- The fancy start screen for Vim. end diff --git a/configs/nvim/lua/plugins/nvim-notify.lua b/configs/nvim/lua/plugins/nvim-notify.lua new file mode 100644 index 0000000..b3b52d4 --- /dev/null +++ b/configs/nvim/lua/plugins/nvim-notify.lua @@ -0,0 +1,7 @@ +local function init() + vim.notify = require("notify") +end + +return { + init = init +} \ No newline at end of file diff --git a/configs/nvim/plugin/packer_compiled.lua b/configs/nvim/plugin/packer_compiled.lua deleted file mode 100644 index 2662fdd..0000000 --- a/configs/nvim/plugin/packer_compiled.lua +++ /dev/null @@ -1,149 +0,0 @@ --- Automatically generated packer.nvim plugin loader code - -if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then - vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"') - return -end - -vim.api.nvim_command('packadd packer.nvim') - -local no_errors, error_msg = pcall(function() - - local time - local profile_info - local should_profile = false - if should_profile then - local hrtime = vim.loop.hrtime - profile_info = {} - time = function(chunk, start) - if start then - profile_info[chunk] = hrtime() - else - profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6 - end - end - else - time = function(chunk, start) end - end - -local function save_profiles(threshold) - local sorted_times = {} - for chunk_name, time_taken in pairs(profile_info) do - sorted_times[#sorted_times + 1] = {chunk_name, time_taken} - end - table.sort(sorted_times, function(a, b) return a[2] > b[2] end) - local results = {} - for i, elem in ipairs(sorted_times) do - if not threshold or threshold and elem[2] > threshold then - results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms' - end - end - - _G._packer = _G._packer or {} - _G._packer.profile_output = results -end - -time([[Luarocks path setup]], true) -local package_path_str = "/home/florian/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/florian/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/florian/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/florian/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" -local install_cpath_pattern = "/home/florian/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so" -if not string.find(package.path, package_path_str, 1, true) then - package.path = package.path .. ';' .. package_path_str -end - -if not string.find(package.cpath, install_cpath_pattern, 1, true) then - package.cpath = package.cpath .. ';' .. install_cpath_pattern -end - -time([[Luarocks path setup]], false) -time([[try_loadstring definition]], true) -local function try_loadstring(s, component, name) - local success, result = pcall(loadstring(s)) - if not success then - vim.schedule(function() - vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {}) - end) - end - return result -end - -time([[try_loadstring definition]], false) -time([[Defining packer_plugins]], true) -_G.packer_plugins = { - ["lazygit.nvim"] = { - loaded = true, - path = "/home/florian/.local/share/nvim/site/pack/packer/start/lazygit.nvim" - }, - ["moonlight.nvim"] = { - loaded = true, - path = "/home/florian/.local/share/nvim/site/pack/packer/start/moonlight.nvim" - }, - ["nvim-autopairs"] = { - loaded = true, - path = "/home/florian/.local/share/nvim/site/pack/packer/start/nvim-autopairs" - }, - ["nvim-comment"] = { - loaded = true, - path = "/home/florian/.local/share/nvim/site/pack/packer/start/nvim-comment" - }, - ["nvim-compe"] = { - loaded = true, - path = "/home/florian/.local/share/nvim/site/pack/packer/start/nvim-compe" - }, - ["nvim-lspconfig"] = { - loaded = true, - path = "/home/florian/.local/share/nvim/site/pack/packer/start/nvim-lspconfig" - }, - ["nvim-lspinstall"] = { - loaded = true, - path = "/home/florian/.local/share/nvim/site/pack/packer/start/nvim-lspinstall" - }, - ["nvim-tree.lua"] = { - loaded = true, - path = "/home/florian/.local/share/nvim/site/pack/packer/start/nvim-tree.lua" - }, - ["nvim-treesitter"] = { - loaded = true, - path = "/home/florian/.local/share/nvim/site/pack/packer/start/nvim-treesitter" - }, - ["nvim-web-devicons"] = { - loaded = true, - path = "/home/florian/.local/share/nvim/site/pack/packer/start/nvim-web-devicons" - }, - ["packer.nvim"] = { - loaded = true, - path = "/home/florian/.local/share/nvim/site/pack/packer/start/packer.nvim" - }, - ["plenary.nvim"] = { - loaded = true, - path = "/home/florian/.local/share/nvim/site/pack/packer/start/plenary.nvim" - }, - ["popup.nvim"] = { - loaded = true, - path = "/home/florian/.local/share/nvim/site/pack/packer/start/popup.nvim" - }, - ["telescope.nvim"] = { - loaded = true, - path = "/home/florian/.local/share/nvim/site/pack/packer/start/telescope.nvim" - }, - vim = { - loaded = true, - path = "/home/florian/.local/share/nvim/site/pack/packer/start/vim" - }, - ["vim-gotham"] = { - loaded = true, - path = "/home/florian/.local/share/nvim/site/pack/packer/start/vim-gotham" - }, - ["vim-startify"] = { - loaded = true, - path = "/home/florian/.local/share/nvim/site/pack/packer/start/vim-startify" - } -} - -time([[Defining packer_plugins]], false) -if should_profile then save_profiles() end - -end) - -if not no_errors then - vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None') -end From e886709d98b66075f11135deb16a6b190df16390 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Thu, 5 Aug 2021 20:57:53 +0200 Subject: [PATCH 3/7] Add tabs manager --- configs/nvim/lua/plugins/init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/nvim/lua/plugins/init.lua b/configs/nvim/lua/plugins/init.lua index e2f5187..1e14ac2 100644 --- a/configs/nvim/lua/plugins/init.lua +++ b/configs/nvim/lua/plugins/init.lua @@ -33,6 +33,7 @@ function install_packages() use 'kdheepak/lazygit.nvim' use 'terrortylor/nvim-comment' use 'rcarriga/nvim-notify' -- fancy notification + use 'romgrk/barbar.nvim' -- Tabs, as understood by any other editor. use 'mhinz/vim-startify' -- The fancy start screen for Vim. end From 43d476107e2db399beefe9bdabb643fc2cd8ffaf Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Thu, 5 Aug 2021 21:19:26 +0200 Subject: [PATCH 4/7] Add hlslens --- configs/nvim/lua/mappings.lua | 8 +++++ configs/nvim/lua/plugins/init.lua | 3 ++ configs/nvim/lua/plugins/nvim-hlslens.lua | 36 +++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 configs/nvim/lua/plugins/nvim-hlslens.lua diff --git a/configs/nvim/lua/mappings.lua b/configs/nvim/lua/mappings.lua index a4c684f..ac1034b 100644 --- a/configs/nvim/lua/mappings.lua +++ b/configs/nvim/lua/mappings.lua @@ -23,6 +23,14 @@ local function init() map('n', 'r', 'lua vim.lsp.buf.references()') map('n', 's', 'lua vim.lsp.buf.document_symbol()') + -------------------- HlsLens ------------------------------- + map('n', 'n', "execute('normal! ' . v:count1 . 'n')lua require('hlslens').start()") + map('n', 'N', "execute('normal! ' . v:count1 . 'N')lua require('hlslens').start()") + map('n', '*', "*lua require('hlslens').start()") + map('n', '#', "#lua require('hlslens').start()") + map('n', 'g*', "g*lua require('hlslens').start()") + map('n', 'g#', "g#lua require('hlslens').start()") + -------------------- LAZYGIT ------------------------------- -- Install docs : https://github.com/jesseduffield/lazygit map('n', 'lg', 'LazyGit') diff --git a/configs/nvim/lua/plugins/init.lua b/configs/nvim/lua/plugins/init.lua index 1e14ac2..0d98a97 100644 --- a/configs/nvim/lua/plugins/init.lua +++ b/configs/nvim/lua/plugins/init.lua @@ -6,6 +6,7 @@ function configure_packages() call_with_helpers(require('plugins.nvim-comment').init) call_with_helpers(require('plugins.nvim-autopairs').init) call_with_helpers(require('plugins.nvim-notify').init) + call_with_helpers(require('plugins.nvim-hlslens').init) end function install_packages() @@ -34,6 +35,8 @@ function install_packages() use 'terrortylor/nvim-comment' use 'rcarriga/nvim-notify' -- fancy notification use 'romgrk/barbar.nvim' -- Tabs, as understood by any other editor. + use 'tpope/vim-endwise' -- auto complete block with end + use 'kevinhwang91/nvim-hlslens' -- nvim-hlslens helps you better glance at matched information, seamlessly jump between matched instances. use 'mhinz/vim-startify' -- The fancy start screen for Vim. end diff --git a/configs/nvim/lua/plugins/nvim-hlslens.lua b/configs/nvim/lua/plugins/nvim-hlslens.lua new file mode 100644 index 0000000..53d1031 --- /dev/null +++ b/configs/nvim/lua/plugins/nvim-hlslens.lua @@ -0,0 +1,36 @@ +local function init() + require('hlslens').setup { + calm_down = true, + override_lens = function(render, plist, nearest, idx, r_idx) + local sfw = vim.v.searchforward == 1 + local indicator, text, chunks + local abs_r_idx = math.abs(r_idx) + if abs_r_idx > 1 then + indicator = string.format('%d%s', abs_r_idx, sfw ~= (r_idx > 1) and '' or '') + elseif abs_r_idx == 1 then + indicator = sfw ~= (r_idx == 1) and '' or '' + else + indicator = '' + end + + local lnum, col = unpack(plist[idx]) + if nearest then + local cnt = #plist + if indicator ~= '' then + text = string.format('[%s %d/%d]', indicator, idx, cnt) + else + text = string.format('[%d/%d]', idx, cnt) + end + chunks = {{' ', 'Ignore'}, {text, 'HlSearchLensNear'}} + else + text = string.format('[%s %d]', indicator, idx) + chunks = {{' ', 'Ignore'}, {text, 'HlSearchLens'}} + end + render.set_virt(0, lnum - 1, col - 1, chunks, nearest) + end + } +end + +return { + init = init +} \ No newline at end of file From 76b65bb50564149c1368f18df19fe36282ccc8d7 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Fri, 6 Aug 2021 12:40:14 +0200 Subject: [PATCH 5/7] Add dart + flutter --- configs/nvim/lua/plugins/init.lua | 3 +++ configs/nvim/lua/plugins/lspconfig/dart.lua | 7 +++++++ configs/nvim/lua/plugins/lspconfig/init.lua | 1 + configs/nvim/lua/plugins/nvim-flutter-tools.lua | 7 +++++++ 4 files changed, 18 insertions(+) create mode 100644 configs/nvim/lua/plugins/lspconfig/dart.lua create mode 100644 configs/nvim/lua/plugins/nvim-flutter-tools.lua diff --git a/configs/nvim/lua/plugins/init.lua b/configs/nvim/lua/plugins/init.lua index 0d98a97..689eea1 100644 --- a/configs/nvim/lua/plugins/init.lua +++ b/configs/nvim/lua/plugins/init.lua @@ -7,6 +7,7 @@ function configure_packages() call_with_helpers(require('plugins.nvim-autopairs').init) call_with_helpers(require('plugins.nvim-notify').init) call_with_helpers(require('plugins.nvim-hlslens').init) + call_with_helpers(require('plugins.nvim-flutter-tools').init) end function install_packages() @@ -37,6 +38,8 @@ function install_packages() use 'romgrk/barbar.nvim' -- Tabs, as understood by any other editor. use 'tpope/vim-endwise' -- auto complete block with end use 'kevinhwang91/nvim-hlslens' -- nvim-hlslens helps you better glance at matched information, seamlessly jump between matched instances. + use 'mfussenegger/nvim-dap' -- debugger + use {'akinsho/flutter-tools.nvim', requires = 'nvim-lua/plenary.nvim'} use 'mhinz/vim-startify' -- The fancy start screen for Vim. end diff --git a/configs/nvim/lua/plugins/lspconfig/dart.lua b/configs/nvim/lua/plugins/lspconfig/dart.lua new file mode 100644 index 0000000..c358c1e --- /dev/null +++ b/configs/nvim/lua/plugins/lspconfig/dart.lua @@ -0,0 +1,7 @@ +local function init() + require'lspconfig'.dartls.setup{} +end + +return { + init = init +} \ No newline at end of file diff --git a/configs/nvim/lua/plugins/lspconfig/init.lua b/configs/nvim/lua/plugins/lspconfig/init.lua index 5c216b9..50b16eb 100644 --- a/configs/nvim/lua/plugins/lspconfig/init.lua +++ b/configs/nvim/lua/plugins/lspconfig/init.lua @@ -4,6 +4,7 @@ local function init() call_with_helpers(require('plugins.lspconfig.typescript').init) call_with_helpers(require('plugins.lspconfig.ruby').init) call_with_helpers(require('plugins.lspconfig.php').init) + call_with_helpers(require('plugins.lspconfig.dart').init) end return { diff --git a/configs/nvim/lua/plugins/nvim-flutter-tools.lua b/configs/nvim/lua/plugins/nvim-flutter-tools.lua new file mode 100644 index 0000000..5ce349b --- /dev/null +++ b/configs/nvim/lua/plugins/nvim-flutter-tools.lua @@ -0,0 +1,7 @@ +local function init() + require('flutter-tools').setup() +end + +return { + init = init +} \ No newline at end of file From 8a0e04ee071c7666422a940bfde3ff01d24c670f Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Fri, 6 Aug 2021 13:30:09 +0200 Subject: [PATCH 6/7] add fterm --- configs/nvim/lua/mappings.lua | 10 +++++++--- configs/nvim/lua/plugins/init.lua | 2 ++ configs/nvim/lua/plugins/nvim-fterm.lua | 15 +++++++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 configs/nvim/lua/plugins/nvim-fterm.lua diff --git a/configs/nvim/lua/mappings.lua b/configs/nvim/lua/mappings.lua index ac1034b..0b6dad2 100644 --- a/configs/nvim/lua/mappings.lua +++ b/configs/nvim/lua/mappings.lua @@ -9,8 +9,8 @@ local function init() map('n', 'ps', [[lua require('telescope.builtin').grep_string({ search = vim.fn.input("Grep For >")})]]) -------------------- NvimTreeToggle ------------------------ - map('n', 'tt', 'NvimTreeToggle') - map('n', 'tr', 'NvimTreeRefresh') + map('n', '', 'NvimTreeToggle') + map('n', '', 'NvimTreeRefresh') -------------------- LSP ----------------------------------- map('n', ',', 'lua vim.lsp.diagnostic.goto_prev()') @@ -31,9 +31,13 @@ local function init() map('n', 'g*', "g*lua require('hlslens').start()") map('n', 'g#', "g#lua require('hlslens').start()") + -------------------- FTerm --------------------------------- + map('n', '', 'lua require("FTerm").toggle()') + map('t', '', 'lua require("FTerm").toggle()') + -------------------- LAZYGIT ------------------------------- -- Install docs : https://github.com/jesseduffield/lazygit - map('n', 'lg', 'LazyGit') + map('n', '', 'LazyGit') -------------------- COMMANDS ------------------------------ cmd 'au TextYankPost * lua vim.highlight.on_yank {on_visual = false}' -- disabled in visual mode diff --git a/configs/nvim/lua/plugins/init.lua b/configs/nvim/lua/plugins/init.lua index 689eea1..6199d52 100644 --- a/configs/nvim/lua/plugins/init.lua +++ b/configs/nvim/lua/plugins/init.lua @@ -8,6 +8,7 @@ function configure_packages() call_with_helpers(require('plugins.nvim-notify').init) call_with_helpers(require('plugins.nvim-hlslens').init) call_with_helpers(require('plugins.nvim-flutter-tools').init) + call_with_helpers(require('plugins.nvim-fterm').init) end function install_packages() @@ -40,6 +41,7 @@ function install_packages() use 'kevinhwang91/nvim-hlslens' -- nvim-hlslens helps you better glance at matched information, seamlessly jump between matched instances. use 'mfussenegger/nvim-dap' -- debugger use {'akinsho/flutter-tools.nvim', requires = 'nvim-lua/plenary.nvim'} + use 'numtostr/FTerm.nvim' -- Floating terminal use 'mhinz/vim-startify' -- The fancy start screen for Vim. end diff --git a/configs/nvim/lua/plugins/nvim-fterm.lua b/configs/nvim/lua/plugins/nvim-fterm.lua new file mode 100644 index 0000000..e35f4f6 --- /dev/null +++ b/configs/nvim/lua/plugins/nvim-fterm.lua @@ -0,0 +1,15 @@ +local function init() + require('FTerm').setup { + dimensions = { + height = 0.8, + width = 0.8, + x = 0.5, + y = 0.5 + }, + border = 'double' + } +end + +return { + init = init +} \ No newline at end of file From ff39e091fed63e9581c210e353bc35809cd3ad08 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Fri, 6 Aug 2021 14:25:03 +0200 Subject: [PATCH 7/7] add few nv-ide plugins --- configs/nvim/lua/plugins/init.lua | 116 +++++++++++++++--- configs/nvim/lua/plugins/nvim-comment.lua | 7 -- configs/nvim/lua/plugins/nvim-ctrlsf.lua | 9 ++ .../nvim/lua/plugins/nvim-editorconfig.lua | 7 ++ configs/nvim/lua/plugins/nvim-feline.lua | 7 ++ configs/nvim/lua/plugins/nvim-gutentags.lua | 17 +++ .../lua/plugins/nvim-indent-blankline.lua | 12 ++ configs/nvim/lua/plugins/nvim-lightspeed.lua | 7 ++ configs/nvim/lua/plugins/nvim-lspkind.lua | 9 ++ configs/nvim/lua/plugins/nvim-neoscroll.lua | 7 ++ configs/nvim/lua/plugins/nvim-numb.lua | 10 ++ configs/nvim/lua/plugins/nvim-signature.lua | 8 ++ .../nvim/lua/plugins/nvim-todo-comments.lua | 7 ++ configs/nvim/lua/plugins/nvim-treesitter.lua | 2 +- 14 files changed, 199 insertions(+), 26 deletions(-) delete mode 100644 configs/nvim/lua/plugins/nvim-comment.lua create mode 100644 configs/nvim/lua/plugins/nvim-ctrlsf.lua create mode 100644 configs/nvim/lua/plugins/nvim-editorconfig.lua create mode 100644 configs/nvim/lua/plugins/nvim-feline.lua create mode 100644 configs/nvim/lua/plugins/nvim-gutentags.lua create mode 100644 configs/nvim/lua/plugins/nvim-indent-blankline.lua create mode 100644 configs/nvim/lua/plugins/nvim-lightspeed.lua create mode 100644 configs/nvim/lua/plugins/nvim-lspkind.lua create mode 100644 configs/nvim/lua/plugins/nvim-neoscroll.lua create mode 100644 configs/nvim/lua/plugins/nvim-numb.lua create mode 100644 configs/nvim/lua/plugins/nvim-signature.lua create mode 100644 configs/nvim/lua/plugins/nvim-todo-comments.lua diff --git a/configs/nvim/lua/plugins/init.lua b/configs/nvim/lua/plugins/init.lua index 6199d52..24b19f0 100644 --- a/configs/nvim/lua/plugins/init.lua +++ b/configs/nvim/lua/plugins/init.lua @@ -3,45 +3,125 @@ function configure_packages() call_with_helpers(require('plugins.compe').init) call_with_helpers(require('plugins.nvim-treesitter').init) call_with_helpers(require('plugins.nvim-web-devicons').init) - call_with_helpers(require('plugins.nvim-comment').init) call_with_helpers(require('plugins.nvim-autopairs').init) call_with_helpers(require('plugins.nvim-notify').init) call_with_helpers(require('plugins.nvim-hlslens').init) call_with_helpers(require('plugins.nvim-flutter-tools').init) call_with_helpers(require('plugins.nvim-fterm').init) + call_with_helpers(require('plugins.nvim-feline').init) + call_with_helpers(require('plugins.nvim-todo-comments').init) + call_with_helpers(require('plugins.nvim-lightspeed').init) + call_with_helpers(require('plugins.nvim-numb').init) + call_with_helpers(require('plugins.nvim-neoscroll').init) + call_with_helpers(require('plugins.nvim-lspkind').init) + call_with_helpers(require('plugins.nvim-signature').init) + call_with_helpers(require('plugins.nvim-gutentags').init) + call_with_helpers(require('plugins.nvim-indent-blankline').init) + call_with_helpers(require('plugins.nvim-editorconfig').init) + call_with_helpers(require('plugins.nvim-ctrlsf').init) end function install_packages() - -- Packer can manage itself + -- Packer can manage itself as an optional plugin use 'wbthomason/packer.nvim' - - use 'dracula/vim' - use 'whatyouhide/vim-gotham' + + -- LSP use 'neovim/nvim-lspconfig' + use 'onsails/lspkind-nvim' use 'kabouzeid/nvim-lspinstall' + + -- Autocomplete use 'hrsh7th/nvim-compe' - use 'shaunsingh/moonlight.nvim' + use 'SirVer/ultisnips' + use 'honza/vim-snippets' use 'windwp/nvim-autopairs' + use 'AndrewRadev/tagalong.vim' + use 'andymass/vim-matchup' + + -- Treesitter + use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' } + use 'p00f/nvim-ts-rainbow' + use 'lukas-reineke/indent-blankline.nvim' + use 'JoosepAlviste/nvim-ts-context-commentstring' + use 'romgrk/nvim-treesitter-context' + + -- Syntax + use 'moll/vim-node' + use 'zinit-zsh/zplugin-vim-syntax' + use 'editorconfig/editorconfig-vim' + use 'chrisbra/csv.vim' + use 'npxbr/glow.nvim' + use 'junegunn/vim-easy-align' + + -- Icons + use 'kyazdani42/nvim-web-devicons' + use 'ryanoasis/vim-devicons' + + -- Status Line and Bufferline + use 'famiu/feline.nvim' -- A minimal, stylish and customizable statusline for Neovim written in Lua + use 'romgrk/barbar.nvim' -- Tabs, as understood by any other editor. -- Telescope project search - use { - 'nvim-telescope/telescope.nvim', - requires = {{'nvim-lua/popup.nvim'}, {'nvim-lua/plenary.nvim'}, {'nvim-lua/popup.nvim'}} - } + use 'nvim-lua/popup.nvim' + use 'nvim-lua/plenary.nvim' + use 'nvim-telescope/telescope.nvim' + use 'nvim-telescope/telescope-fzy-native.nvim' + use 'nvim-telescope/telescope-project.nvim' + use 'fhill2/telescope-ultisnips.nvim' - use 'nvim-treesitter/nvim-treesitter' - - use 'kyazdani42/nvim-web-devicons' -- removing this line doesn't change the error + -- Explorer use 'kyazdani42/nvim-tree.lua' + + -- Git use 'kdheepak/lazygit.nvim' - use 'terrortylor/nvim-comment' - use 'rcarriga/nvim-notify' -- fancy notification - use 'romgrk/barbar.nvim' -- Tabs, as understood by any other editor. - use 'tpope/vim-endwise' -- auto complete block with end + + -- Flutter + use 'akinsho/flutter-tools.nvim' + + -- Move & Search & replace + use 'windwp/nvim-spectre' + use 'nacro90/numb.nvim' + use 'dyng/ctrlsf.vim' use 'kevinhwang91/nvim-hlslens' -- nvim-hlslens helps you better glance at matched information, seamlessly jump between matched instances. + use 'ggandor/lightspeed.nvim' + use 'kshenoy/vim-signature' + use 'karb94/neoscroll.nvim' + use 'dstein64/nvim-scrollview' + use 'chaoren/vim-wordmotion' + + -- Tim Pope docet + use 'tpope/vim-sensible' + use 'tpope/vim-rails' + use 'tpope/vim-abolish' + use 'tpope/vim-surround' + use 'tpope/vim-bundler' + use 'tpope/vim-capslock' + use 'tpope/vim-repeat' + use 'tpope/vim-endwise' -- auto complete block with end + use 'tpope/vim-rvm' + use 'tpope/vim-dispatch' + use 'tpope/vim-dadbod' + use 'tpope/vim-jdaddy' + use 'tpope/vim-fugitive' + use 'tpope/vim-commentary' + + -- Tmux + use 'christoomey/vim-tmux-navigator' + + -- Colorschema + use 'dracula/vim' + use 'whatyouhide/vim-gotham' + use 'shaunsingh/moonlight.nvim' + + -- Tags + use 'ludovicchabant/vim-gutentags' + + -- General Plugins + use 'rcarriga/nvim-notify' -- fancy notification use 'mfussenegger/nvim-dap' -- debugger - use {'akinsho/flutter-tools.nvim', requires = 'nvim-lua/plenary.nvim'} use 'numtostr/FTerm.nvim' -- Floating terminal + use 'folke/todo-comments.nvim' + use 'lambdalisue/suda.vim' use 'mhinz/vim-startify' -- The fancy start screen for Vim. end diff --git a/configs/nvim/lua/plugins/nvim-comment.lua b/configs/nvim/lua/plugins/nvim-comment.lua deleted file mode 100644 index 8224471..0000000 --- a/configs/nvim/lua/plugins/nvim-comment.lua +++ /dev/null @@ -1,7 +0,0 @@ -local function init() - require('nvim_comment').setup() -end - -return { - init = init -} \ No newline at end of file diff --git a/configs/nvim/lua/plugins/nvim-ctrlsf.lua b/configs/nvim/lua/plugins/nvim-ctrlsf.lua new file mode 100644 index 0000000..c97c136 --- /dev/null +++ b/configs/nvim/lua/plugins/nvim-ctrlsf.lua @@ -0,0 +1,9 @@ +local function init() + g.ctrlsf_ackprg = 'rg' + g.ctrls_auto_preview = 1 + g.ctrlsf_search_mode = 'async' +end + +return { + init = init +} \ No newline at end of file diff --git a/configs/nvim/lua/plugins/nvim-editorconfig.lua b/configs/nvim/lua/plugins/nvim-editorconfig.lua new file mode 100644 index 0000000..edcc6fd --- /dev/null +++ b/configs/nvim/lua/plugins/nvim-editorconfig.lua @@ -0,0 +1,7 @@ +local function init() + g.EditorConfig_exclude_patterns = { 'fugitive://.*', 'scp://.*' } +end + +return { + init = init +} \ No newline at end of file diff --git a/configs/nvim/lua/plugins/nvim-feline.lua b/configs/nvim/lua/plugins/nvim-feline.lua new file mode 100644 index 0000000..2ca3ac9 --- /dev/null +++ b/configs/nvim/lua/plugins/nvim-feline.lua @@ -0,0 +1,7 @@ +local function init() + require('feline').setup() +end + +return { + init = init +} \ No newline at end of file diff --git a/configs/nvim/lua/plugins/nvim-gutentags.lua b/configs/nvim/lua/plugins/nvim-gutentags.lua new file mode 100644 index 0000000..bf733b9 --- /dev/null +++ b/configs/nvim/lua/plugins/nvim-gutentags.lua @@ -0,0 +1,17 @@ +local function init() + cmd('set tags+=tags,.git/tags') + g.gutentags_enabled = 1 + g.gutentags_generate_on_missing = 1 + g.gutentags_generate_on_write = 1 + g.gutentags_resolve_symlinks = 1 + g.gutentags_ctags_tagfile = '.git/tags' + g.gutentags_project_root = { '.git' } + g.gutentags_ctags_extra_args = { '--fields=+l' } + g.gutentags_add_default_project_roots = 0 + g.gutentags_ctags_executable_ruby = 'ripper-tags' + g.gutentags_ctags_extra_args = { '--ignore-unsupported-options', '--recursive' } +end + +return { + init = init +} \ No newline at end of file diff --git a/configs/nvim/lua/plugins/nvim-indent-blankline.lua b/configs/nvim/lua/plugins/nvim-indent-blankline.lua new file mode 100644 index 0000000..9c5a278 --- /dev/null +++ b/configs/nvim/lua/plugins/nvim-indent-blankline.lua @@ -0,0 +1,12 @@ +local function init() + g.indent_blankline_show_current_context = true + g.indent_blankline_buftype_exclude = {'terminal'} + g.indent_blankline_filetype_exclude = {'help', 'startify', 'dashboard', 'packer', 'neogitstatus', 'NvimTree'} + g.indent_blankline_char = '▏' + g.indent_blankline_use_treesitter = true + g.indent_blankline_show_trailing_blankline_indent = false +end + +return { + init = init +} \ No newline at end of file diff --git a/configs/nvim/lua/plugins/nvim-lightspeed.lua b/configs/nvim/lua/plugins/nvim-lightspeed.lua new file mode 100644 index 0000000..e3fbd94 --- /dev/null +++ b/configs/nvim/lua/plugins/nvim-lightspeed.lua @@ -0,0 +1,7 @@ +local function init() + require("lightspeed").setup {} +end + +return { + init = init +} \ No newline at end of file diff --git a/configs/nvim/lua/plugins/nvim-lspkind.lua b/configs/nvim/lua/plugins/nvim-lspkind.lua new file mode 100644 index 0000000..b240e21 --- /dev/null +++ b/configs/nvim/lua/plugins/nvim-lspkind.lua @@ -0,0 +1,9 @@ +local function init() + require('lspkind').init { + with_text = true, + } +end + +return { + init = init +} \ No newline at end of file diff --git a/configs/nvim/lua/plugins/nvim-neoscroll.lua b/configs/nvim/lua/plugins/nvim-neoscroll.lua new file mode 100644 index 0000000..45c4efe --- /dev/null +++ b/configs/nvim/lua/plugins/nvim-neoscroll.lua @@ -0,0 +1,7 @@ +local function init() + require('neoscroll').setup() +end + +return { + init = init +} \ No newline at end of file diff --git a/configs/nvim/lua/plugins/nvim-numb.lua b/configs/nvim/lua/plugins/nvim-numb.lua new file mode 100644 index 0000000..a2cec5a --- /dev/null +++ b/configs/nvim/lua/plugins/nvim-numb.lua @@ -0,0 +1,10 @@ +local function init() + require('numb').setup { + show_numbers = true, -- Enable 'number' for the window while peeking + show_cursorline = true -- Enable 'cursorline' for the window while peeking + } +end + +return { + init = init +} \ No newline at end of file diff --git a/configs/nvim/lua/plugins/nvim-signature.lua b/configs/nvim/lua/plugins/nvim-signature.lua new file mode 100644 index 0000000..9f93972 --- /dev/null +++ b/configs/nvim/lua/plugins/nvim-signature.lua @@ -0,0 +1,8 @@ +local function init() + g.SignatureMarkTextHLDynamic = 1 + g.SignatureMarkerTextHLDynamic = 1 +end + +return { + init = init +} \ No newline at end of file diff --git a/configs/nvim/lua/plugins/nvim-todo-comments.lua b/configs/nvim/lua/plugins/nvim-todo-comments.lua new file mode 100644 index 0000000..29274e3 --- /dev/null +++ b/configs/nvim/lua/plugins/nvim-todo-comments.lua @@ -0,0 +1,7 @@ +local function init() + require("todo-comments").setup {} +end + +return { + init = init +} \ No newline at end of file diff --git a/configs/nvim/lua/plugins/nvim-treesitter.lua b/configs/nvim/lua/plugins/nvim-treesitter.lua index 72f554b..1f64e47 100644 --- a/configs/nvim/lua/plugins/nvim-treesitter.lua +++ b/configs/nvim/lua/plugins/nvim-treesitter.lua @@ -1,6 +1,6 @@ local function init() require'nvim-treesitter.configs'.setup { - ensure_installed = "maintained", -- list of languages + ensure_installed = "all", -- list of languages highlight = { enable = true, },