Skip to content

Commit dfb6c70

Browse files
author
Ali Shahid
committed
[plugin configs] huge update
1 parent 3417e45 commit dfb6c70

14 files changed

+333
-208
lines changed

lua/plugins/commits.lua

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
-- Generated by: https://github.com/pullape/LCommit
2-
-- on 2022-07-02_17:17:46
2+
-- on 2022-07-14_13:03:37
33

44
return {
5-
packer_nvim = 'd268d2e083ca0abd95a57dfbcc5d5637a615e219',
5+
packer_nvim = 'e4c2afb37d31e99b399425e102c58b091fbc16be',
66
filetype_nvim = 'b522628a45a17d58fc0073ffd64f9dc9530a8027',
77
Abstract_cs = '04ac9f79651a39deda73987ee43e3e14a5868056',
8-
nvim_lsp_installer = 'c13ea61d85e2170af35c06b47bcba143cf2f244b',
9-
nvim_lspconfig = '057ca6b7f5312f323eb7212f9282ed723560bc3f',
8+
nvim_lsp_installer = 'd6d564b21167161d85f41c2033ccc19a97b39a39',
9+
nvim_lspconfig = '22bf8c4a549367893fdf7a6194aa87c5265fb9ca',
1010
lspkind_nvim = '57e5b5dfbe991151b07d272a06e365a77cc3d0e7',
11-
nvim_treesitter = '78931d8bf15468d8f11f0c7910d470e88493b36b',
11+
nvim_treesitter = 'b46cb0389d92abffa516be487e7ea0610e8ce35b',
1212
playground = 'ce7e4b757598f1c785ed0fd94fc65959acd7d39c',
1313
nvim_cmp = '9897465a7663997b7b42372164ffc3635321a2fe',
1414
cmp_nvim_lsp = 'affe808a5c56b71630f17aa7c38e15c59fd648a8',
@@ -17,40 +17,41 @@ return {
1717
cmp_luasnip = 'a9de941bcbda508d0a45d28ae366bb3f08db2e36',
1818
cmp_nvim_lsp_signature_help = '007dd2740d9b70f2688db01a39d6d25b7169cd57',
1919
cmp_nvim_lua = 'd276254e7198ab7d00f117e88e223b4bd8c02d21',
20-
LuaSnip = 'a12441e0598e93e67235eba67c8e6fbffc896f06',
21-
friendly_snippets = '688691050074f39e6ec987321738494e08ba562e',
22-
null_ls_nvim = 'a2b7bf89663c78d58a5494efbb791819a24bb025',
23-
nvim_autopairs = '4a95b3982be7397cd8e1370d1a09503f9b002dbf',
24-
telescope_nvim = '7df95f9b208ba7228a25e7f75fb4cc02d6604cce',
20+
LuaSnip = '7d78278c2a935b8cd1b6b43065223e14490f3133',
21+
friendly_snippets = '0e516c9d9892d6bf268492136971d315dd704d16',
22+
null_ls_nvim = 'c9348b47918bee72b541580adf31e963c9028f82',
23+
nvim_autopairs = '972a7977e759733dd6721af7bcda7a67e40c010e',
24+
telescope_nvim = 'b79cd6c88b3d96b0f49cb7d240807cd59b610cd8',
2525
popup_nvim = 'b7404d35d5d3548a82149238289fa71f7f6de4ac',
26-
plenary_nvim = '968a4b9afec0c633bc369662e78f8c5db0eba249',
26+
plenary_nvim = '986ad71ae930c7d96e812734540511b4ca838aa2',
2727
telescope_fzf_native_nvim = '6a33ecefa9b3d9ade654f9a7a6396a00c3758ca6',
28-
telescope_file_browser_nvim = '61a5521853ac739ae3d0d395f52c1178108e0114',
28+
telescope_file_browser_nvim = 'd17f47bb563f4e761b7db120357d2f1b7630186f',
2929
telescope_media_files_nvim = '513e4ee385edd72bf0b35a217b7e39f84b6fe93c',
3030
telescope_ui_select_nvim = '62ea5e58c7bbe191297b983a9e7e89420f581369',
3131
nvim_ts_context_commentstring = '88343753dbe81c227a1c1fd2c8d764afb8d36269',
3232
vim_floaterm = 'e3f2d94d722603f8b65088ea1d7e0329951985bd',
33-
nvim_web_devicons = '8d2c5337f0a2d0a17de8e751876eeb192b32310e',
33+
nvim_web_devicons = '2d02a56189e2bde11edd4712fea16f08a6656944',
3434
vim_maximizer = '2e54952fe91e140a2e69f35f22131219fcd9c5f1',
35-
Comment_nvim = '4086630ce2aaf76b2652516ee3169f0b558f6be1',
35+
Comment_nvim = '7c49fb2ac01a9f03410100c8e78f647bbea857e8',
3636
nvim_colorizer_lua = '36c610a9717cc9ec426a07c8e6bf3b3abcb139d6',
3737
indent_blankline_nvim = '4a58fe6e9854ccfe6c6b0f59abb7cb8301e23025',
38-
gitsigns_nvim = '4883988cf8b623f63cc8c7d3f11b18b7e81f06ff',
38+
gitsigns_nvim = 'bb6c3bf6f584e73945a0913bb3adf77b60d6f6a2',
3939
trouble_nvim = 'da61737d860ddc12f78e638152834487eabf0ee5',
40-
nvim_bufferline_lua = '68839d62785edfb4ff7a7b3c1e9f4b64d55749e8',
40+
nvim_bufferline_lua = 'd7b775a35be9c80ed591d3335b35ec84e5c5d81e',
4141
scope_nvim = '2db6d31de8e3a98d2b41c0f0d1f5dc299ee76875',
42-
nvim_tree_lua = 'cbbc799e6c5784fba9b6a842000caaebf07fa122',
43-
feline_nvim = '1ea42671c523a080a01c62c40c2c8e7fc0139a8f',
44-
alpha_nvim = 'ef27a59e5b4d7b1c2fe1950da3fe5b1c5f3b4c94',
45-
penvim = '877d37cddddc7d3a8c534295cdbef9f082d1776f',
42+
nvim_tree_lua = '0f96e32326a842798b6b8e638a91464521e4ef71',
43+
feline_nvim = '2962c8c4a67f41ef35c58aa367ff2afb7a9691d3',
44+
alpha_nvim = '417e756951cb0395f080f2c0eda84c8aadcbb80e',
45+
penvim = '308f9af41d62dc20a416f1929b68297a70e86944',
4646
goto_preview = '99407d8e63305a5c68627cee156ca3991a75fd19',
4747
neovim_session_manager = '9652b392805dfd497877342e54c5a71be7907daf',
4848
renamer_nvim = '4a4707992a79f481f4882bab9b3823ac6455c942',
49-
editorconfig_nvim = 'b96a75a470e5c26caf4e57c594e85ee5d0dc7bf1',
50-
hop_nvim = '86e03769392f824ed8ed08de5b6afe6acc7fbdb3',
51-
flutter_tools_nvim = '6b13345dd7ffe3b0a08536b8fadfa288af137616',
49+
editorconfig_nvim = '918279fe8a432aea7555fae4aac52c705d7f3c2e',
50+
hop_nvim = '6bcaeb7c0ea30afe137db11fcf681c373a7171bf',
51+
flutter_tools_nvim = '8b0d82f1aa6d09cad74489d35d9fecfdc7fa45ec',
5252
awesome_flutter_snippets = 'a4f6448e457f492231f742ec51b077d8dd6f1831',
5353
dart_vim_plugin = '81e50e80329e5eac2c115f45585b1838a614d07a',
5454
nvim_ts_autotag = '044a05c4c51051326900a53ba98fddacd15fea22',
55-
impatient_nvim = '969f2c5c90457612c09cf2a13fee1adaa986d350',
55+
impatient_nvim = '2aa872de40dbbebe8e2d3a0b8c5651b81fe8b235',
56+
nvim_surround = '325ed0328f6b37d274cc25bea6dd36f42569a26a',
5657
}

lua/plugins/goto-preview.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,12 @@ require('goto-preview').setup {
6262
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --
6363

6464
local options = { noremap=true }
65-
vim.api.nvim_set_keymap("n", "<Space>pd", "<cmd>lua require('goto-preview').goto_preview_definition()<CR>", options)
66-
vim.api.nvim_set_keymap("n", "<Space>pi", "<cmd>lua require('goto-preview').goto_preview_implementation()<CR>", options)
65+
vim.api.nvim_set_keymap("n", "gpd", "<cmd>lua require('goto-preview').goto_preview_definition()<CR>", options)
66+
vim.api.nvim_set_keymap("n", "gpi", "<cmd>lua require('goto-preview').goto_preview_implementation()<CR>", options)
6767
-- Only set if telescope is installed
68-
vim.api.nvim_set_keymap("n", "<Space>pr", "<cmd>lua require('goto-preview').goto_preview_references()<CR>", options)
69-
vim.api.nvim_set_keymap("n", "<Space>P", "<cmd>lua require('goto-preview').close_all_win()<CR>", options)
68+
vim.api.nvim_set_keymap("n", "gpr", "<cmd>lua require('goto-preview').goto_preview_references()<CR>", options)
69+
70+
vim.api.nvim_set_keymap("n", "gP", "<cmd>lua require('goto-preview').close_all_win()<CR>", options)
7071

7172
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --
7273
-- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ --

lua/plugins/neovim-session-manager.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ local session_imported, session = pcall(require, 'session_manager')
1919
if not session_imported then return end
2020

2121
session.setup({
22-
sessions_dir = vim.fn.expand('~/.cache/nvim/sessions'), -- The directory where the session files will be saved.
22+
sessions_dir = vim.fn.stdpath('data').."/.cache/sessions", -- The directory where the session files will be saved.
2323
path_replacer = '__', -- The character to which the path separator will be replaced for session files.
2424
colon_replacer = '++', -- The character to which the colon symbol will be replaced for session files.
2525
autoload_mode = require('session_manager.config').AutoloadMode.Disabled, -- Define what to do when Neovim is started without arguments. Possible values: Disabled, CurrentDir, LastSession

lua/plugins/null-ls_nvim.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ vim.api.nvim_create_autocmd("FileType", {
179179
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --
180180

181181
local keymap = vim.api.nvim_set_keymap
182-
keymap('n', 'gf', '<ESC>:lua vim.lsp.buf.formatting_sync()<CR>', {noremap = true, silent = true})
182+
keymap('n', 'gf', '<ESC>:lua vim.lsp.buf.format{ async=true }<CR>', {noremap = true, silent = true})
183183

184184
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --
185185
-- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ --

lua/plugins/nvim-bufferline_lua.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ keymap('n', '<Leader>,', ':BufferLineMovePrev<CR>', options)
162162
-- nnoremap <silent> <A-c> :BufferClose<CR>
163163

164164
-- Magic buffer-picking mode
165-
keymap('n', '<Space><Space>', ':BufferLinePick<CR>', options)
165+
keymap('n', '<Leader><\\>', ':BufferLinePick<CR>', options)
166166

167167
-- go to buffer number
168168
keymap('n', '<Leader>1', ':BufferLineGoToBuffer 1<CR>', options)

lua/plugins/nvim-cmp.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ vim.o.completeopt = 'menuone,noselect'
2020
local cmp_imported_ok, cmp = pcall(require, 'cmp')
2121
if not cmp_imported_ok then return end
2222

23+
local luasnip_imported_ok, luasnip = pcall(require, 'luasnip')
24+
if not luasnip_imported_ok then return end
25+
2326
-- for completion window width
2427
local ELLIPSIS_CHAR = ''
2528
local MAX_LABEL_WIDTH = 35
@@ -44,7 +47,7 @@ cmp.setup({
4447
},
4548

4649
snippet = {
47-
expand = function(args) require('luasnip').lsp_expand(args.body) end,
50+
expand = function(args) luasnip.lsp_expand(args.body) end,
4851
},
4952

5053
formatting = {
@@ -116,9 +119,6 @@ cmp.setup({
116119
-- :match("%s") == nil
117120
-- end
118121

119-
local luasnip_imported_ok, luasnip = pcall(require, 'luasnip')
120-
if not luasnip_imported_ok then return end
121-
122122
cmp.setup({
123123
mapping = {
124124
['<C-Space>'] = cmp.mapping.complete({}),

lua/plugins/nvim-lsp-installer.lua

Lines changed: 30 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,22 @@
1414
-- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ --
1515
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --
1616

17-
local lspinstaller_imported, lspinstaller = pcall(require, 'nvim-lsp-installer')
18-
if not lspinstaller_imported then return end
17+
local M = {}
1918

19+
M.setup = {
2020

21-
lspinstaller.setup{
21+
-- A list of servers to automatically install if they're not already installed. Example: { "rust_analyzer", "sumneko_lua" }
22+
-- This setting has no relation with the `automatic_installation` setting.
23+
-- ensure_installed = {"sumneko_lua"},
2224

23-
-- A list of servers to automatically install if they're not already installed. Example: { "rust_analyzer", "sumneko_lua" }
24-
-- This setting has no relation with the `automatic_installation` setting.
25-
-- ensure_installed = {"sumneko_lua"},
26-
27-
-- Whether servers that are set up (via lspconfig) should be automatically installed if they're not already installed.
28-
-- This setting has no relation with the `ensure_installed` setting.
29-
-- Can either be:
30-
-- - false: Servers are not automatically installed.
31-
-- - true: All servers set up via lspconfig are automatically installed.
32-
-- - { exclude: string[] }: All servers set up via lspconfig, except the ones provided in the list, are automatically installed.
33-
-- Example: automatic_installation = { exclude = { "rust_analyzer", "solargraph" } }
34-
automatic_installation = false,
25+
-- Whether servers that are set up (via lspconfig) should be automatically installed if they're not already installed.
26+
-- This setting has no relation with the `ensure_installed` setting.
27+
-- Can either be:
28+
-- - false: Servers are not automatically installed.
29+
-- - true: All servers set up via lspconfig are automatically installed.
30+
-- - { exclude: string[] }: All servers set up via lspconfig, except the ones provided in the list, are automatically installed.
31+
-- Example: automatic_installation = { exclude = { "rust_analyzer", "solargraph" } }
32+
automatic_installation = false,
3533

3634
ui = {
3735
-- Whether to automatically check for outdated servers when opening the UI window.
@@ -43,22 +41,22 @@ lspinstaller.setup{
4341
server_pending = "",
4442
server_uninstalled = "",
4543
},
46-
keymaps = {
47-
-- Keymap to expand a server in the UI
48-
toggle_server_expand = "<CR>",
49-
-- Keymap to install the server under the current cursor position
50-
install_server = "i",
51-
-- Keymap to reinstall/update the server under the current cursor position
52-
update_server = "u",
53-
-- Keymap to check for new version for the server under the current cursor position
54-
check_server_version = "c",
55-
-- Keymap to update all installed servers
56-
update_all_servers = "U",
57-
-- Keymap to check which installed servers are outdated
58-
check_outdated_servers = "C",
59-
-- Keymap to uninstall a server
60-
uninstall_server = "X",
61-
},
44+
keymaps = {
45+
-- Keymap to expand a server in the UI
46+
toggle_server_expand = "<CR>",
47+
-- Keymap to install the server under the current cursor position
48+
install_server = "i",
49+
-- Keymap to reinstall/update the server under the current cursor position
50+
update_server = "u",
51+
-- Keymap to check for new version for the server under the current cursor position
52+
check_server_version = "c",
53+
-- Keymap to update all installed servers
54+
update_all_servers = "U",
55+
-- Keymap to check which installed servers are outdated
56+
check_outdated_servers = "C",
57+
-- Keymap to uninstall a server
58+
uninstall_server = "X",
59+
},
6260
},
6361

6462
-- The directory in which to install all servers.
@@ -73,79 +71,7 @@ lspinstaller.setup{
7371
max_concurrent_installers = 4,
7472
}
7573

76-
77-
-- ───────────────────────────────────────────────── --
78-
-- setup LSPs manually
79-
-- ───────────────────────────────────────────────── --
80-
local installed_servers = lspinstaller.get_installed_servers()
81-
-- don't setup servers if atleast one server is installed, or it will throw an error
82-
if #installed_servers == 0 then return end
83-
84-
-- always call require("lspconfig") after require("nvim-lsp-installer").setup {}, this is the way
85-
local lspconfig_imported, lspconfig = pcall(require, 'lspconfig')
86-
if not lspconfig_imported then return end
87-
88-
local capabilities = vim.lsp.protocol.make_client_capabilities()
89-
-- import lsp configs/options which are managed in seprate file, nvim-lspconfig.lua
90-
local lsp_options = require("plugins.nvim-lspconfig").options
91-
92-
93-
for _, server in ipairs(installed_servers) do
94-
95-
-- for lua
96-
if server.name == "sumneko_lua" then
97-
lsp_options.settings = {
98-
Lua = {
99-
diagnostics = {
100-
-- Get the language server to recognize the 'vim', 'use' global
101-
globals = {'vim', 'use', 'require'},
102-
},
103-
workspace = {
104-
-- Make the server aware of Neovim runtime files
105-
library = vim.api.nvim_get_runtime_file("", true),
106-
},
107-
-- Do not send telemetry data containing a randomized but unique identifier
108-
telemetry = {enable = false},
109-
},
110-
}
111-
end
112-
113-
-- for clangd (c/c++)
114-
-- [https://github.com/jose-elias-alvarez/null-ls.nvim/issues/428]
115-
if server.name == "clangd" then
116-
capabilities.offsetEncoding = { "utf-16" }
117-
lsp_options.capabilities = capabilities
118-
end
119-
120-
-- for html
121-
if server.name == "html" then
122-
lsp_options.filetypes = {"html", "htmldjango"}
123-
end
124-
125-
-- for css / scss / sass
126-
if server.name == "cssls" then
127-
128-
--[==[
129-
Neovim does not currently include built-in snippets.
130-
`vscode-css-language-server` only provides completions when snippet support is enabled.
131-
To enable completion, install a snippet plugin and add the following override to your
132-
language client capabilities during setup. Enable (broadcasting) snippet capability for completion
133-
https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/cssls.lua
134-
--]==]
135-
capabilities.textDocument.completion.completionItem.snippetSupport = true
136-
lsp_options.capabilities = capabilities
137-
end
138-
139-
lspconfig[server.name].setup(lsp_options)
140-
end
141-
142-
-- for Flutter and Dart
143-
-- don't put this on loop to set it because dart LSP installed and maintained by akinsho/flutter-tools.nvim
144-
lspconfig["dartls"].setup(lsp_options)
145-
-- ───────────────────────────────────────────────── --
146-
-- end LSP setup
147-
-- ───────────────────────────────────────────────── --
148-
74+
return M
14975

15076
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --
15177
-- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ --

0 commit comments

Comments
 (0)