Skip to content

Commit

Permalink
[plugin configs] huge update
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali Shahid committed Jul 14, 2022
1 parent 3417e45 commit dfb6c70
Show file tree
Hide file tree
Showing 14 changed files with 333 additions and 208 deletions.
49 changes: 25 additions & 24 deletions lua/plugins/commits.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
-- Generated by: https://github.com/pullape/LCommit
-- on 2022-07-02_17:17:46
-- on 2022-07-14_13:03:37

return {
packer_nvim = 'd268d2e083ca0abd95a57dfbcc5d5637a615e219',
packer_nvim = 'e4c2afb37d31e99b399425e102c58b091fbc16be',
filetype_nvim = 'b522628a45a17d58fc0073ffd64f9dc9530a8027',
Abstract_cs = '04ac9f79651a39deda73987ee43e3e14a5868056',
nvim_lsp_installer = 'c13ea61d85e2170af35c06b47bcba143cf2f244b',
nvim_lspconfig = '057ca6b7f5312f323eb7212f9282ed723560bc3f',
nvim_lsp_installer = 'd6d564b21167161d85f41c2033ccc19a97b39a39',
nvim_lspconfig = '22bf8c4a549367893fdf7a6194aa87c5265fb9ca',
lspkind_nvim = '57e5b5dfbe991151b07d272a06e365a77cc3d0e7',
nvim_treesitter = '78931d8bf15468d8f11f0c7910d470e88493b36b',
nvim_treesitter = 'b46cb0389d92abffa516be487e7ea0610e8ce35b',
playground = 'ce7e4b757598f1c785ed0fd94fc65959acd7d39c',
nvim_cmp = '9897465a7663997b7b42372164ffc3635321a2fe',
cmp_nvim_lsp = 'affe808a5c56b71630f17aa7c38e15c59fd648a8',
Expand All @@ -17,40 +17,41 @@ return {
cmp_luasnip = 'a9de941bcbda508d0a45d28ae366bb3f08db2e36',
cmp_nvim_lsp_signature_help = '007dd2740d9b70f2688db01a39d6d25b7169cd57',
cmp_nvim_lua = 'd276254e7198ab7d00f117e88e223b4bd8c02d21',
LuaSnip = 'a12441e0598e93e67235eba67c8e6fbffc896f06',
friendly_snippets = '688691050074f39e6ec987321738494e08ba562e',
null_ls_nvim = 'a2b7bf89663c78d58a5494efbb791819a24bb025',
nvim_autopairs = '4a95b3982be7397cd8e1370d1a09503f9b002dbf',
telescope_nvim = '7df95f9b208ba7228a25e7f75fb4cc02d6604cce',
LuaSnip = '7d78278c2a935b8cd1b6b43065223e14490f3133',
friendly_snippets = '0e516c9d9892d6bf268492136971d315dd704d16',
null_ls_nvim = 'c9348b47918bee72b541580adf31e963c9028f82',
nvim_autopairs = '972a7977e759733dd6721af7bcda7a67e40c010e',
telescope_nvim = 'b79cd6c88b3d96b0f49cb7d240807cd59b610cd8',
popup_nvim = 'b7404d35d5d3548a82149238289fa71f7f6de4ac',
plenary_nvim = '968a4b9afec0c633bc369662e78f8c5db0eba249',
plenary_nvim = '986ad71ae930c7d96e812734540511b4ca838aa2',
telescope_fzf_native_nvim = '6a33ecefa9b3d9ade654f9a7a6396a00c3758ca6',
telescope_file_browser_nvim = '61a5521853ac739ae3d0d395f52c1178108e0114',
telescope_file_browser_nvim = 'd17f47bb563f4e761b7db120357d2f1b7630186f',
telescope_media_files_nvim = '513e4ee385edd72bf0b35a217b7e39f84b6fe93c',
telescope_ui_select_nvim = '62ea5e58c7bbe191297b983a9e7e89420f581369',
nvim_ts_context_commentstring = '88343753dbe81c227a1c1fd2c8d764afb8d36269',
vim_floaterm = 'e3f2d94d722603f8b65088ea1d7e0329951985bd',
nvim_web_devicons = '8d2c5337f0a2d0a17de8e751876eeb192b32310e',
nvim_web_devicons = '2d02a56189e2bde11edd4712fea16f08a6656944',
vim_maximizer = '2e54952fe91e140a2e69f35f22131219fcd9c5f1',
Comment_nvim = '4086630ce2aaf76b2652516ee3169f0b558f6be1',
Comment_nvim = '7c49fb2ac01a9f03410100c8e78f647bbea857e8',
nvim_colorizer_lua = '36c610a9717cc9ec426a07c8e6bf3b3abcb139d6',
indent_blankline_nvim = '4a58fe6e9854ccfe6c6b0f59abb7cb8301e23025',
gitsigns_nvim = '4883988cf8b623f63cc8c7d3f11b18b7e81f06ff',
gitsigns_nvim = 'bb6c3bf6f584e73945a0913bb3adf77b60d6f6a2',
trouble_nvim = 'da61737d860ddc12f78e638152834487eabf0ee5',
nvim_bufferline_lua = '68839d62785edfb4ff7a7b3c1e9f4b64d55749e8',
nvim_bufferline_lua = 'd7b775a35be9c80ed591d3335b35ec84e5c5d81e',
scope_nvim = '2db6d31de8e3a98d2b41c0f0d1f5dc299ee76875',
nvim_tree_lua = 'cbbc799e6c5784fba9b6a842000caaebf07fa122',
feline_nvim = '1ea42671c523a080a01c62c40c2c8e7fc0139a8f',
alpha_nvim = 'ef27a59e5b4d7b1c2fe1950da3fe5b1c5f3b4c94',
penvim = '877d37cddddc7d3a8c534295cdbef9f082d1776f',
nvim_tree_lua = '0f96e32326a842798b6b8e638a91464521e4ef71',
feline_nvim = '2962c8c4a67f41ef35c58aa367ff2afb7a9691d3',
alpha_nvim = '417e756951cb0395f080f2c0eda84c8aadcbb80e',
penvim = '308f9af41d62dc20a416f1929b68297a70e86944',
goto_preview = '99407d8e63305a5c68627cee156ca3991a75fd19',
neovim_session_manager = '9652b392805dfd497877342e54c5a71be7907daf',
renamer_nvim = '4a4707992a79f481f4882bab9b3823ac6455c942',
editorconfig_nvim = 'b96a75a470e5c26caf4e57c594e85ee5d0dc7bf1',
hop_nvim = '86e03769392f824ed8ed08de5b6afe6acc7fbdb3',
flutter_tools_nvim = '6b13345dd7ffe3b0a08536b8fadfa288af137616',
editorconfig_nvim = '918279fe8a432aea7555fae4aac52c705d7f3c2e',
hop_nvim = '6bcaeb7c0ea30afe137db11fcf681c373a7171bf',
flutter_tools_nvim = '8b0d82f1aa6d09cad74489d35d9fecfdc7fa45ec',
awesome_flutter_snippets = 'a4f6448e457f492231f742ec51b077d8dd6f1831',
dart_vim_plugin = '81e50e80329e5eac2c115f45585b1838a614d07a',
nvim_ts_autotag = '044a05c4c51051326900a53ba98fddacd15fea22',
impatient_nvim = '969f2c5c90457612c09cf2a13fee1adaa986d350',
impatient_nvim = '2aa872de40dbbebe8e2d3a0b8c5651b81fe8b235',
nvim_surround = '325ed0328f6b37d274cc25bea6dd36f42569a26a',
}
9 changes: 5 additions & 4 deletions lua/plugins/goto-preview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ require('goto-preview').setup {
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --

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

vim.api.nvim_set_keymap("n", "gP", "<cmd>lua require('goto-preview').close_all_win()<CR>", options)

-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --
-- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ --
Expand Down
2 changes: 1 addition & 1 deletion lua/plugins/neovim-session-manager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ local session_imported, session = pcall(require, 'session_manager')
if not session_imported then return end

session.setup({
sessions_dir = vim.fn.expand('~/.cache/nvim/sessions'), -- The directory where the session files will be saved.
sessions_dir = vim.fn.stdpath('data').."/.cache/sessions", -- The directory where the session files will be saved.
path_replacer = '__', -- The character to which the path separator will be replaced for session files.
colon_replacer = '++', -- The character to which the colon symbol will be replaced for session files.
autoload_mode = require('session_manager.config').AutoloadMode.Disabled, -- Define what to do when Neovim is started without arguments. Possible values: Disabled, CurrentDir, LastSession
Expand Down
2 changes: 1 addition & 1 deletion lua/plugins/null-ls_nvim.lua
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ vim.api.nvim_create_autocmd("FileType", {
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --

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

-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --
-- ━━━━━━━━━━━━━━━━━❰ end Mappings ❱━━━━━━━━━━━━━━━━ --
Expand Down
2 changes: 1 addition & 1 deletion lua/plugins/nvim-bufferline_lua.lua
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ keymap('n', '<Leader>,', ':BufferLineMovePrev<CR>', options)
-- nnoremap <silent> <A-c> :BufferClose<CR>

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

-- go to buffer number
keymap('n', '<Leader>1', ':BufferLineGoToBuffer 1<CR>', options)
Expand Down
8 changes: 4 additions & 4 deletions lua/plugins/nvim-cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ vim.o.completeopt = 'menuone,noselect'
local cmp_imported_ok, cmp = pcall(require, 'cmp')
if not cmp_imported_ok then return end

local luasnip_imported_ok, luasnip = pcall(require, 'luasnip')
if not luasnip_imported_ok then return end

-- for completion window width
local ELLIPSIS_CHAR = ''
local MAX_LABEL_WIDTH = 35
Expand All @@ -44,7 +47,7 @@ cmp.setup({
},

snippet = {
expand = function(args) require('luasnip').lsp_expand(args.body) end,
expand = function(args) luasnip.lsp_expand(args.body) end,
},

formatting = {
Expand Down Expand Up @@ -116,9 +119,6 @@ cmp.setup({
-- :match("%s") == nil
-- end

local luasnip_imported_ok, luasnip = pcall(require, 'luasnip')
if not luasnip_imported_ok then return end

cmp.setup({
mapping = {
['<C-Space>'] = cmp.mapping.complete({}),
Expand Down
134 changes: 30 additions & 104 deletions lua/plugins/nvim-lsp-installer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,22 @@
-- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ --
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --

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

M.setup = {

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

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

-- Whether servers that are set up (via lspconfig) should be automatically installed if they're not already installed.
-- This setting has no relation with the `ensure_installed` setting.
-- Can either be:
-- - false: Servers are not automatically installed.
-- - true: All servers set up via lspconfig are automatically installed.
-- - { exclude: string[] }: All servers set up via lspconfig, except the ones provided in the list, are automatically installed.
-- Example: automatic_installation = { exclude = { "rust_analyzer", "solargraph" } }
automatic_installation = false,
-- Whether servers that are set up (via lspconfig) should be automatically installed if they're not already installed.
-- This setting has no relation with the `ensure_installed` setting.
-- Can either be:
-- - false: Servers are not automatically installed.
-- - true: All servers set up via lspconfig are automatically installed.
-- - { exclude: string[] }: All servers set up via lspconfig, except the ones provided in the list, are automatically installed.
-- Example: automatic_installation = { exclude = { "rust_analyzer", "solargraph" } }
automatic_installation = false,

ui = {
-- Whether to automatically check for outdated servers when opening the UI window.
Expand All @@ -43,22 +41,22 @@ lspinstaller.setup{
server_pending = "",
server_uninstalled = "",
},
keymaps = {
-- Keymap to expand a server in the UI
toggle_server_expand = "<CR>",
-- Keymap to install the server under the current cursor position
install_server = "i",
-- Keymap to reinstall/update the server under the current cursor position
update_server = "u",
-- Keymap to check for new version for the server under the current cursor position
check_server_version = "c",
-- Keymap to update all installed servers
update_all_servers = "U",
-- Keymap to check which installed servers are outdated
check_outdated_servers = "C",
-- Keymap to uninstall a server
uninstall_server = "X",
},
keymaps = {
-- Keymap to expand a server in the UI
toggle_server_expand = "<CR>",
-- Keymap to install the server under the current cursor position
install_server = "i",
-- Keymap to reinstall/update the server under the current cursor position
update_server = "u",
-- Keymap to check for new version for the server under the current cursor position
check_server_version = "c",
-- Keymap to update all installed servers
update_all_servers = "U",
-- Keymap to check which installed servers are outdated
check_outdated_servers = "C",
-- Keymap to uninstall a server
uninstall_server = "X",
},
},

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


-- ───────────────────────────────────────────────── --
-- setup LSPs manually
-- ───────────────────────────────────────────────── --
local installed_servers = lspinstaller.get_installed_servers()
-- don't setup servers if atleast one server is installed, or it will throw an error
if #installed_servers == 0 then return end

-- always call require("lspconfig") after require("nvim-lsp-installer").setup {}, this is the way
local lspconfig_imported, lspconfig = pcall(require, 'lspconfig')
if not lspconfig_imported then return end

local capabilities = vim.lsp.protocol.make_client_capabilities()
-- import lsp configs/options which are managed in seprate file, nvim-lspconfig.lua
local lsp_options = require("plugins.nvim-lspconfig").options


for _, server in ipairs(installed_servers) do

-- for lua
if server.name == "sumneko_lua" then
lsp_options.settings = {
Lua = {
diagnostics = {
-- Get the language server to recognize the 'vim', 'use' global
globals = {'vim', 'use', 'require'},
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {enable = false},
},
}
end

-- for clangd (c/c++)
-- [https://github.com/jose-elias-alvarez/null-ls.nvim/issues/428]
if server.name == "clangd" then
capabilities.offsetEncoding = { "utf-16" }
lsp_options.capabilities = capabilities
end

-- for html
if server.name == "html" then
lsp_options.filetypes = {"html", "htmldjango"}
end

-- for css / scss / sass
if server.name == "cssls" then

--[==[
Neovim does not currently include built-in snippets.
`vscode-css-language-server` only provides completions when snippet support is enabled.
To enable completion, install a snippet plugin and add the following override to your
language client capabilities during setup. Enable (broadcasting) snippet capability for completion
https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/cssls.lua
--]==]
capabilities.textDocument.completion.completionItem.snippetSupport = true
lsp_options.capabilities = capabilities
end

lspconfig[server.name].setup(lsp_options)
end

-- for Flutter and Dart
-- don't put this on loop to set it because dart LSP installed and maintained by akinsho/flutter-tools.nvim
lspconfig["dartls"].setup(lsp_options)
-- ───────────────────────────────────────────────── --
-- end LSP setup
-- ───────────────────────────────────────────────── --

return M

-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --
-- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ --
Expand Down
Loading

0 comments on commit dfb6c70

Please sign in to comment.