Several changes to nvim setup

This commit is contained in:
Fabian Becker 2021-12-29 10:13:15 +01:00
parent 8ce283c530
commit 703f2cb966
7 changed files with 537 additions and 12 deletions

View File

@ -17,12 +17,12 @@ require('lsp.terraform-ls')
require('plugins.telescope')
require('plugins.telescope-project')
require('plugins.treesitter')
-- require('plugins.compe')
require('plugins.cmp')
require('plugins.which-key')
require('plugins.lualine')
--require('plugins.barbar')
require('plugins.tagbar')
require('plugins.sneak')
require('themes.nord')
require('go').setup()

View File

@ -6,7 +6,7 @@ O = {
clipboard = unnamedplus,
incsearch = true,
termguicolors = true,
colorscheme = 'onedark',
colorscheme = 'dracula',
hidden_files = true,
wrap_lines = false,
number = true,

View File

@ -37,7 +37,7 @@ vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
virtual_text = {
prefix = "",
spacing = 0,
spacing = 1,
},
signs = true,
underline = true,
@ -73,12 +73,7 @@ vim.lsp.protocol.CompletionItemKind = {
"  (TypeParameter)"
}
--[[ " autoformat
autocmd BufWritePre *.js lua vim.lsp.buf.formatting_sync(nil, 100)
autocmd BufWritePre *.jsx lua vim.lsp.buf.formatting_sync(nil, 100)
autocmd BufWritePre *.lua lua vim.lsp.buf.formatting_sync(nil, 100) ]]
-- Java
-- autocmd FileType java nnoremap ca <Cmd>lua require('jdtls').code_action()<CR>
vim.cmd("autocmd BufWritePre *.go :silent! lua require('go.format').gofmt()")
local function documentHighlight(client, bufnr)
-- Set autocommands conditional on server_capabilities

View File

@ -92,7 +92,7 @@ return require("packer").startup(
use {'hrsh7th/cmp-cmdline'}
use {'hrsh7th/nvim-cmp'}
-- use {'glepnir/lspsaga.nvim'}
-- use {'glepnir/lspsaga.nvim'} -- Has a bug
use {'tami5/lspsaga.nvim'}
use {'kabouzeid/nvim-lspinstall'}
use {'nvim-lua/lsp-status.nvim'}
@ -113,6 +113,8 @@ return require("packer").startup(
-- => Language Support
use {'neoclide/jsonc.vim'}
use {'ray-x/go.nvim'}
-- use {'vim-python/python-syntax', ft={'python'}, opt=true}
-- let g:python_highlight_all = 1
@ -128,6 +130,7 @@ return require("packer").startup(
use {'shaunsingh/moonlight.nvim', as='moonlight'}
use {'arcticicestudio/nord-vim'}
use {'joshdick/onedark.vim'}
use {'sainnhe/everforest'}
require_plugin('julia-vim')
end

View File

@ -1,7 +1,7 @@
require'lualine'.setup {
options = {
icons_enabled = true,
theme = 'nord',
theme = 'dracula',
--component_separators = {'', ''},
--section_separators = {'', ''},
disabled_filetypes = {}

View File

@ -0,0 +1,292 @@
-- 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/fbecker18/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/Users/fbecker18/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/Users/fbecker18/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/Users/fbecker18/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
local install_cpath_pattern = "/Users/fbecker18/.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), name, _G.packer_plugins[name])
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 = {
["JuliaFormatter.vim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/JuliaFormatter.vim",
url = "https://github.com/kdheepak/JuliaFormatter.vim"
},
["cmp-buffer"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/cmp-buffer",
url = "https://github.com/hrsh7th/cmp-buffer"
},
["cmp-cmdline"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/cmp-cmdline",
url = "https://github.com/hrsh7th/cmp-cmdline"
},
["cmp-nvim-lsp"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
url = "https://github.com/hrsh7th/cmp-nvim-lsp"
},
["cmp-path"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/cmp-path",
url = "https://github.com/hrsh7th/cmp-path"
},
["darcula-solid.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/darcula-solid.nvim",
url = "https://github.com/briones-gabriel/darcula-solid.nvim"
},
dracula = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/dracula",
url = "https://github.com/dracula/vim"
},
["editorconfig-vim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/editorconfig-vim",
url = "https://github.com/editorconfig/editorconfig-vim"
},
["go.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/go.nvim",
url = "https://github.com/ray-x/go.nvim"
},
["jsonc.vim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/jsonc.vim",
url = "https://github.com/neoclide/jsonc.vim"
},
["julia-vim"] = {
loaded = false,
needs_bufread = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/opt/julia-vim",
url = "https://github.com/JuliaEditorSupport/julia-vim"
},
["lsp-status.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/lsp-status.nvim",
url = "https://github.com/nvim-lua/lsp-status.nvim"
},
["lspsaga.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/lspsaga.nvim",
url = "https://github.com/tami5/lspsaga.nvim"
},
["lualine.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/lualine.nvim",
url = "https://github.com/nvim-lualine/lualine.nvim"
},
["lush.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/lush.nvim",
url = "https://github.com/rktjmp/lush.nvim"
},
moonlight = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/moonlight",
url = "https://github.com/shaunsingh/moonlight.nvim"
},
nerdcommenter = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/nerdcommenter",
url = "https://github.com/preservim/nerdcommenter"
},
nerdtree = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/nerdtree",
url = "https://github.com/preservim/nerdtree"
},
["nerdtree-git-plugin"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/nerdtree-git-plugin",
url = "https://github.com/Xuyuanp/nerdtree-git-plugin"
},
["nord-vim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/nord-vim",
url = "https://github.com/arcticicestudio/nord-vim"
},
["nvim-cmp"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/nvim-cmp",
url = "https://github.com/hrsh7th/nvim-cmp"
},
["nvim-lspconfig"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
url = "https://github.com/neovim/nvim-lspconfig"
},
["nvim-lspinstall"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/nvim-lspinstall",
url = "https://github.com/kabouzeid/nvim-lspinstall"
},
["nvim-treesitter"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
url = "https://github.com/nvim-treesitter/nvim-treesitter"
},
["nvim-web-devicons"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",
url = "https://github.com/kyazdani42/nvim-web-devicons"
},
["onedark.vim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/onedark.vim",
url = "https://github.com/joshdick/onedark.vim"
},
["packer.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/packer.nvim",
url = "https://github.com/wbthomason/packer.nvim"
},
["plenary.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/plenary.nvim",
url = "https://github.com/nvim-lua/plenary.nvim"
},
["popup.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/popup.nvim",
url = "https://github.com/nvim-lua/popup.nvim"
},
["symbols-outline.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/symbols-outline.nvim",
url = "https://github.com/simrat39/symbols-outline.nvim"
},
tagbar = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/tagbar",
url = "https://github.com/preservim/tagbar"
},
["telescope-project.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/telescope-project.nvim",
url = "https://github.com/nvim-telescope/telescope-project.nvim"
},
["telescope.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/telescope.nvim",
url = "https://github.com/nvim-telescope/telescope.nvim"
},
["vim-devicons"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/vim-devicons",
url = "https://github.com/ryanoasis/vim-devicons"
},
["vim-easy-align"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/vim-easy-align",
url = "https://github.com/junegunn/vim-easy-align"
},
["vim-floaterm"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/vim-floaterm",
url = "https://github.com/voldikss/vim-floaterm"
},
["vim-fugitive"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/vim-fugitive",
url = "https://github.com/tpope/vim-fugitive"
},
["vim-gitgutter"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/vim-gitgutter",
url = "https://github.com/airblade/vim-gitgutter"
},
["vim-highlightedyank"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/vim-highlightedyank",
url = "https://github.com/machakann/vim-highlightedyank"
},
["vim-sneak"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/vim-sneak",
url = "https://github.com/justinmk/vim-sneak"
},
["vim-surround"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/vim-surround",
url = "https://github.com/tpope/vim-surround"
},
["which-key.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/which-key.nvim",
url = "https://github.com/folke/which-key.nvim"
}
}
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

View File

@ -0,0 +1,235 @@
" Automatically generated packer.nvim plugin loader code
if !has('nvim-0.5')
echohl WarningMsg
echom "Invalid Neovim version for packer.nvim!"
echohl None
finish
endif
packadd packer.nvim
try
lua << END
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/fbecker18/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/Users/fbecker18/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/Users/fbecker18/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/Users/fbecker18/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
local install_cpath_pattern = "/Users/fbecker18/.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
print('Error running ' .. component .. ' for ' .. name)
error(result)
end
return result
end
time("try_loadstring definition", false)
time("Defining packer_plugins", true)
_G.packer_plugins = {
["JuliaFormatter.vim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/JuliaFormatter.vim"
},
["darcula-solid.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/darcula-solid.nvim"
},
dracula = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/dracula"
},
["editorconfig-vim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/editorconfig-vim"
},
["jsonc.vim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/jsonc.vim"
},
["julia-vim"] = {
loaded = false,
needs_bufread = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/opt/julia-vim"
},
["lsp-status.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/lsp-status.nvim"
},
["lspsaga.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/lspsaga.nvim"
},
["lualine.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/lualine.nvim"
},
["lush.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/lush.nvim"
},
moonlight = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/moonlight"
},
nerdcommenter = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/nerdcommenter"
},
nerdtree = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/nerdtree"
},
["nerdtree-git-plugin"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/nerdtree-git-plugin"
},
["nord-vim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/nord-vim"
},
["nvim-compe"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/nvim-compe"
},
["nvim-lspconfig"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/nvim-lspconfig"
},
["nvim-lspinstall"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/nvim-lspinstall"
},
["nvim-treesitter"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/nvim-treesitter"
},
["nvim-web-devicons"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/nvim-web-devicons"
},
["packer.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/packer.nvim"
},
["plenary.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/plenary.nvim"
},
["popup.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/popup.nvim"
},
["symbols-outline.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/symbols-outline.nvim"
},
tagbar = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/tagbar"
},
["telescope-project.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/telescope-project.nvim"
},
["telescope.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/telescope.nvim"
},
["vim-abolish"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/vim-abolish"
},
["vim-devicons"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/vim-devicons"
},
["vim-easy-align"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/vim-easy-align"
},
["vim-floaterm"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/vim-floaterm"
},
["vim-fugitive"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/vim-fugitive"
},
["vim-gitgutter"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/vim-gitgutter"
},
["vim-highlightedyank"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/vim-highlightedyank"
},
["vim-sneak"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/vim-sneak"
},
["vim-surround"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/vim-surround"
},
["which-key.nvim"] = {
loaded = true,
path = "/Users/fbecker18/.local/share/nvim/site/pack/packer/start/which-key.nvim"
}
}
time("Defining packer_plugins", false)
if should_profile then save_profiles() end
END
catch
echohl ErrorMsg
echom "Error in packer_compiled: " .. v:exception
echom "Please check your config for correctness"
echohl None
endtry