Minor changes and setup for vscode extension.
This commit is contained in:
parent
03e3ce1f77
commit
288f5b0e12
5 changed files with 201 additions and 19 deletions
39
init.lua
39
init.lua
|
|
@ -1,21 +1,26 @@
|
||||||
require('nv-globals')
|
if (vim.api.nvim_eval('exists("g:vscode")')) then
|
||||||
require('plugins')
|
require('settings')
|
||||||
require('colorscheme')
|
require('keymappings')
|
||||||
require('settings')
|
else
|
||||||
require('keymappings')
|
require('nv-globals')
|
||||||
|
require('plugins')
|
||||||
|
require('colorscheme')
|
||||||
|
require('settings')
|
||||||
|
require('keymappings')
|
||||||
|
|
||||||
-- LSP
|
-- LSP
|
||||||
require('lsp')
|
require('lsp')
|
||||||
require('lsp.typescript-ls')
|
require('lsp.typescript-ls')
|
||||||
require('lsp.python-ls')
|
require('lsp.python-ls')
|
||||||
require('lsp.lua-ls')
|
require('lsp.lua-ls')
|
||||||
require('lsp.elixir-ls')
|
require('lsp.elixir-ls')
|
||||||
require('lsp.go-ls')
|
require('lsp.go-ls')
|
||||||
|
|
||||||
-- Completion
|
-- Completion
|
||||||
require('nv-compe')
|
require('nv-compe')
|
||||||
|
|
||||||
-- Function signatures
|
-- Function signatures
|
||||||
require('lsp_signature')
|
require('lsp_signature')
|
||||||
|
|
||||||
require('nv-prettier')
|
require('nv-prettier')
|
||||||
|
end
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,11 @@ vim.api.nvim_set_keymap('o', '<C-g>', '<ESC>', {silent = true})
|
||||||
vim.api.nvim_set_keymap('l', '<C-g>', '<ESC>', {silent = true})
|
vim.api.nvim_set_keymap('l', '<C-g>', '<ESC>', {silent = true})
|
||||||
vim.api.nvim_set_keymap('t', '<C-g>', '<ESC>', {silent = true})
|
vim.api.nvim_set_keymap('t', '<C-g>', '<ESC>', {silent = true})
|
||||||
|
|
||||||
|
-- Move left and right when in insert mode.
|
||||||
|
vim.api.nvim_set_keymap("i", '<C-l>', '<Right>', {silent = true})
|
||||||
|
vim.api.nvim_set_keymap("i", '<C-h>', '<Left>', {silent = true})
|
||||||
|
|
||||||
|
|
||||||
-- Quick save.
|
-- Quick save.
|
||||||
vim.api.nvim_set_keymap('n', '<Leader>fw', ':w<CR>', {silent = true})
|
vim.api.nvim_set_keymap('n', '<Leader>fw', ':w<CR>', {silent = true})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
lspconfig = require "lspconfig"
|
local lspconfig = require "lspconfig"
|
||||||
lspconfig.gopls.setup {
|
lspconfig.gopls.setup {
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
require "lsp_signature".on_attach({
|
require "lsp_signature".on_attach({
|
||||||
|
|
@ -14,6 +14,7 @@ lspconfig.gopls.setup {
|
||||||
end,
|
end,
|
||||||
cmd = {"gopls", "serve"},
|
cmd = {"gopls", "serve"},
|
||||||
settings = {
|
settings = {
|
||||||
|
autostart = true,
|
||||||
gopls = {
|
gopls = {
|
||||||
analyses = {
|
analyses = {
|
||||||
unusedparams = true,
|
unusedparams = true,
|
||||||
|
|
@ -21,6 +22,7 @@ lspconfig.gopls.setup {
|
||||||
staticcheck = true,
|
staticcheck = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
autostart = true,
|
||||||
root_dir = lspconfig.util.root_pattern(".git","go.mod"),
|
root_dir = lspconfig.util.root_pattern(".git","go.mod"),
|
||||||
init_options = {usePlaceholders = true, completeUnimported = true},
|
init_options = {usePlaceholders = true, completeUnimported = true},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ vim.o.updatetime = 300 -- Faster completion
|
||||||
vim.o.timeoutlen = 500 -- By default timeoutlen is 1000 ms
|
vim.o.timeoutlen = 500 -- By default timeoutlen is 1000 ms
|
||||||
|
|
||||||
vim.cmd(":set number relativenumber")
|
vim.cmd(":set number relativenumber")
|
||||||
vim.cmd("highlight ColorColumn ctermbg=0 guibg=lightgrey")
|
vim.cmd("highlight ColorColumn ctermbg=0 guibg=grey")
|
||||||
------ Folding
|
------ Folding
|
||||||
-- vim.o.foldlevel = 99
|
-- vim.o.foldlevel = 99
|
||||||
-- Persist folds.
|
-- Persist folds.
|
||||||
|
|
|
||||||
170
plugin/packer_compiled.lua
Normal file
170
plugin/packer_compiled.lua
Normal file
|
|
@ -0,0 +1,170 @@
|
||||||
|
-- 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 = "/Users/marianouvalle/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/Users/marianouvalle/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/Users/marianouvalle/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/Users/marianouvalle/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
|
||||||
|
local install_cpath_pattern = "/Users/marianouvalle/.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 = {
|
||||||
|
["auto-pairs"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/marianouvalle/.local/share/nvim/site/pack/packer/start/auto-pairs"
|
||||||
|
},
|
||||||
|
["black-nvim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/marianouvalle/.local/share/nvim/site/pack/packer/start/black-nvim"
|
||||||
|
},
|
||||||
|
["gitsigns.nvim"] = {
|
||||||
|
config = { "\27LJ\2\n6\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\rgitsigns\frequire\0" },
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/marianouvalle/.local/share/nvim/site/pack/packer/start/gitsigns.nvim"
|
||||||
|
},
|
||||||
|
["lightline.vim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/marianouvalle/.local/share/nvim/site/pack/packer/start/lightline.vim"
|
||||||
|
},
|
||||||
|
["lsp_signature.nvim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/marianouvalle/.local/share/nvim/site/pack/packer/start/lsp_signature.nvim"
|
||||||
|
},
|
||||||
|
["lspsaga.nvim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/marianouvalle/.local/share/nvim/site/pack/packer/start/lspsaga.nvim"
|
||||||
|
},
|
||||||
|
["nvim-compe"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/marianouvalle/.local/share/nvim/site/pack/packer/start/nvim-compe"
|
||||||
|
},
|
||||||
|
["nvim-lspconfig"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/marianouvalle/.local/share/nvim/site/pack/packer/start/nvim-lspconfig"
|
||||||
|
},
|
||||||
|
["nvim-lspinstall"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/marianouvalle/.local/share/nvim/site/pack/packer/start/nvim-lspinstall"
|
||||||
|
},
|
||||||
|
["nvim-web-devicons"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/marianouvalle/.local/share/nvim/site/pack/packer/start/nvim-web-devicons"
|
||||||
|
},
|
||||||
|
["packer.nvim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/marianouvalle/.local/share/nvim/site/pack/packer/start/packer.nvim"
|
||||||
|
},
|
||||||
|
["palenight.vim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/marianouvalle/.local/share/nvim/site/pack/packer/start/palenight.vim"
|
||||||
|
},
|
||||||
|
["plenary.nvim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/marianouvalle/.local/share/nvim/site/pack/packer/start/plenary.nvim"
|
||||||
|
},
|
||||||
|
["popup.nvim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/marianouvalle/.local/share/nvim/site/pack/packer/start/popup.nvim"
|
||||||
|
},
|
||||||
|
["telescope.nvim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/marianouvalle/.local/share/nvim/site/pack/packer/start/telescope.nvim"
|
||||||
|
},
|
||||||
|
["vim-commentary"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/marianouvalle/.local/share/nvim/site/pack/packer/start/vim-commentary"
|
||||||
|
},
|
||||||
|
["vim-go"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/marianouvalle/.local/share/nvim/site/pack/packer/start/vim-go"
|
||||||
|
},
|
||||||
|
["vim-polyglot"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/marianouvalle/.local/share/nvim/site/pack/packer/start/vim-polyglot"
|
||||||
|
},
|
||||||
|
["vim-prettier"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/marianouvalle/.local/share/nvim/site/pack/packer/start/vim-prettier"
|
||||||
|
},
|
||||||
|
["vim-rooter"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/marianouvalle/.local/share/nvim/site/pack/packer/start/vim-rooter"
|
||||||
|
},
|
||||||
|
["vim-styled-components"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/marianouvalle/.local/share/nvim/site/pack/packer/start/vim-styled-components"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
time([[Defining packer_plugins]], false)
|
||||||
|
-- Config for: gitsigns.nvim
|
||||||
|
time([[Config for gitsigns.nvim]], true)
|
||||||
|
try_loadstring("\27LJ\2\n6\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\rgitsigns\frequire\0", "config", "gitsigns.nvim")
|
||||||
|
time([[Config for gitsigns.nvim]], 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue