Chores
This commit is contained in:
parent
c610b52ccf
commit
abac026ed6
13
init.lua
13
init.lua
|
@ -5,8 +5,8 @@ local cmd = vim.cmd
|
||||||
local o, wo, bo = vim.o, vim.wo, vim.bo
|
local o, wo, bo = vim.o, vim.wo, vim.bo
|
||||||
local utils = require 'config.utils'
|
local utils = require 'config.utils'
|
||||||
local opt = utils.opt
|
local opt = utils.opt
|
||||||
local autocmd = utils.autocmd
|
-- local autocmd = utils.autocmd
|
||||||
local map = utils.map
|
-- local map = utils.map
|
||||||
local let = utils.let
|
local let = utils.let
|
||||||
local tilde = os.getenv('HOME')
|
local tilde = os.getenv('HOME')
|
||||||
|
|
||||||
|
@ -77,6 +77,9 @@ cmd [[command! PackerSync packadd packer.nvim | lua require('plugins').sync()]]
|
||||||
cmd [[command! PackerClean packadd packer.nvim | lua require('plugins').clean()]]
|
cmd [[command! PackerClean packadd packer.nvim | lua require('plugins').clean()]]
|
||||||
cmd [[command! PackerCompile packadd packer.nvim | lua require('plugins').compile()]]
|
cmd [[command! PackerCompile packadd packer.nvim | lua require('plugins').compile()]]
|
||||||
|
|
||||||
|
-- issue with python 3.10 (https://github.com/neovim/neovim/issues/14586)
|
||||||
|
g.python3_host_prog = '/usr/bin/python3'
|
||||||
|
|
||||||
-- Colortheme
|
-- Colortheme
|
||||||
|
|
||||||
require('config.theme')
|
require('config.theme')
|
||||||
|
@ -97,7 +100,7 @@ Mapper = require("nvim-mapper")
|
||||||
local map = Mapper.map
|
local map = Mapper.map
|
||||||
|
|
||||||
-- - Telescope-related
|
-- - Telescope-related
|
||||||
local opts = {noremap = true, silent = true}
|
local opts = { noremap = true, silent = true }
|
||||||
map('n', '<Leader>ff', '<cmd>Telescope find_files<cr>', opts, "Telescope", "find_files", "Find files from current position")
|
map('n', '<Leader>ff', '<cmd>Telescope find_files<cr>', opts, "Telescope", "find_files", "Find files from current position")
|
||||||
map('n', '<Leader>fg', '<cmd>Telescope git_files<cr>', opts, "Telescope", "git_files", "Find git-tracked files")
|
map('n', '<Leader>fg', '<cmd>Telescope git_files<cr>', opts, "Telescope", "git_files", "Find git-tracked files")
|
||||||
map('n', '<Leader>fb', '<cmd>Telescope buffers<cr>', opts, "Telescope", "buffers", "Search in current opened buffers")
|
map('n', '<Leader>fb', '<cmd>Telescope buffers<cr>', opts, "Telescope", "buffers", "Search in current opened buffers")
|
||||||
|
@ -113,7 +116,7 @@ map('n', '<Leader>ld', '<cmd>Telescope lsp_definitions<cr>', opts, "Telescope",
|
||||||
map('n', '<Leader>ls', '<cmd>Telescope lsp_document_symbols<cr>', opts, "Telescope", "lsp_document_symbols", "Show symbols in document using LSP")
|
map('n', '<Leader>ls', '<cmd>Telescope lsp_document_symbols<cr>', opts, "Telescope", "lsp_document_symbols", "Show symbols in document using LSP")
|
||||||
|
|
||||||
-- Undo tree
|
-- Undo tree
|
||||||
map('n', '<Leader>u', '<cmd>UndotreeToggle<cr><cmd>UndotreeFocus<cr>', {noremap = true}, "UndoTree", "undo_tree_toggle", "Toggle UndoTree browser")
|
map('n', '<Leader>u', '<cmd>UndotreeToggle<cr><cmd>UndotreeFocus<cr>', { noremap = true }, "UndoTree", "undo_tree_toggle", "Toggle UndoTree browser")
|
||||||
|
|
||||||
-- Split maximizer
|
-- Split maximizer
|
||||||
map('n', '<Leader>mm', '<cmd>MaximizerToggle<cr>', opts, "MaximizerToggle", "maximizer_toggle_n", "Toggle maximal view of current split")
|
map('n', '<Leader>mm', '<cmd>MaximizerToggle<cr>', opts, "MaximizerToggle", "maximizer_toggle_n", "Toggle maximal view of current split")
|
||||||
|
@ -144,7 +147,7 @@ map('n', '<Leader><Tab>', '<cmd>bnext<cr>', {}, "Movement", "go_to_next_buf", "S
|
||||||
map('n', '<Leader>\\', '<cmd>bprev<cr>', {}, "Movement", "go_to_prev_buf", "Switch to the previous buffer")
|
map('n', '<Leader>\\', '<cmd>bprev<cr>', {}, "Movement", "go_to_prev_buf", "Switch to the previous buffer")
|
||||||
|
|
||||||
-- Move selection around
|
-- Move selection around
|
||||||
cmd ([[
|
cmd([[
|
||||||
nnoremap <silent> <C-Down> :m .+1<CR>==
|
nnoremap <silent> <C-Down> :m .+1<CR>==
|
||||||
nnoremap <silent> <C-Up> :m .-2<CR>==
|
nnoremap <silent> <C-Up> :m .-2<CR>==
|
||||||
inoremap <silent> <C-Down> <Esc>:m .+1<CR>==gi
|
inoremap <silent> <C-Down> <Esc>:m .+1<CR>==gi
|
||||||
|
|
|
@ -23,13 +23,25 @@ local let = utils.let
|
||||||
-- let('g', 'airline_powerline_fonts ', 1)
|
-- let('g', 'airline_powerline_fonts ', 1)
|
||||||
|
|
||||||
-- github-theme
|
-- github-theme
|
||||||
|
lualine_c = {function()
|
||||||
|
return vim.fn['nvim_treesitter#statusline'](90)
|
||||||
|
end}
|
||||||
|
|
||||||
require('lualine').setup({
|
require('lualine').setup({
|
||||||
options = {
|
options = {
|
||||||
theme = "tokionight"
|
theme = "tokyonight",
|
||||||
-- theme = "github"
|
-- theme = "github"
|
||||||
-- section_separators = {'', ''},
|
-- section_separators = {'', ''},
|
||||||
-- component_separators = {'', ''}
|
-- component_separators = {'', ''}
|
||||||
|
sections = {
|
||||||
|
lualine_a = {'mode'},
|
||||||
|
lualine_b = {'branch', 'diff', 'diagnostics'},
|
||||||
|
-- lualine_c = {'filename'},
|
||||||
|
lualine_c = lualine_c,
|
||||||
|
lualine_x = {'encoding', 'fileformat', 'filetype'},
|
||||||
|
lualine_y = {'progress'},
|
||||||
|
lualine_z = {'location'}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -37,6 +49,8 @@ require('lualine').setup({
|
||||||
-- function_style = "italic",
|
-- function_style = "italic",
|
||||||
-- theme_style = "dimmed"
|
-- theme_style = "dimmed"
|
||||||
-- })
|
-- })
|
||||||
vim.g.tokyonight_style = "storm"
|
-- vim.g.tokyonight_style = "storm"
|
||||||
|
-- vim.g.tokyonight_style = "day"
|
||||||
|
vim.g.tokyonight_style = "night"
|
||||||
vim.g.tokyonight_italic_functions = true
|
vim.g.tokyonight_italic_functions = true
|
||||||
cmd[[colorscheme tokyonight]]
|
cmd[[colorscheme tokyonight]]
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
local packer = nil
|
local packer = nil
|
||||||
|
|
||||||
|
vim.lsp.set_log_level("debug")
|
||||||
local function init()
|
local function init()
|
||||||
if packer == nil then
|
if packer == nil then
|
||||||
packer = require 'packer'
|
packer = require 'packer'
|
||||||
|
|
|
@ -44,8 +44,8 @@ local function save_profiles(threshold)
|
||||||
end
|
end
|
||||||
|
|
||||||
time([[Luarocks path setup]], true)
|
time([[Luarocks path setup]], true)
|
||||||
local package_path_str = "/home/leo/.cache/nvim/packer_hererocks/2.0.5/share/lua/5.1/?.lua;/home/leo/.cache/nvim/packer_hererocks/2.0.5/share/lua/5.1/?/init.lua;/home/leo/.cache/nvim/packer_hererocks/2.0.5/lib/luarocks/rocks-5.1/?.lua;/home/leo/.cache/nvim/packer_hererocks/2.0.5/lib/luarocks/rocks-5.1/?/init.lua"
|
local package_path_str = "/home/leo/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/leo/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/leo/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/leo/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
|
||||||
local install_cpath_pattern = "/home/leo/.cache/nvim/packer_hererocks/2.0.5/lib/lua/5.1/?.so"
|
local install_cpath_pattern = "/home/leo/.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
|
if not string.find(package.path, package_path_str, 1, true) then
|
||||||
package.path = package.path .. ';' .. package_path_str
|
package.path = package.path .. ';' .. package_path_str
|
||||||
end
|
end
|
||||||
|
@ -57,7 +57,7 @@ end
|
||||||
time([[Luarocks path setup]], false)
|
time([[Luarocks path setup]], false)
|
||||||
time([[try_loadstring definition]], true)
|
time([[try_loadstring definition]], true)
|
||||||
local function try_loadstring(s, component, name)
|
local function try_loadstring(s, component, name)
|
||||||
local success, result = pcall(loadstring(s))
|
local success, result = pcall(loadstring(s), name, _G.packer_plugins[name])
|
||||||
if not success then
|
if not success then
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {})
|
vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {})
|
||||||
|
@ -74,6 +74,11 @@ _G.packer_plugins = {
|
||||||
path = "/home/leo/.local/share/nvim/site/pack/packer/start/auto-pairs",
|
path = "/home/leo/.local/share/nvim/site/pack/packer/start/auto-pairs",
|
||||||
url = "https://github.com/jiangmiao/auto-pairs"
|
url = "https://github.com/jiangmiao/auto-pairs"
|
||||||
},
|
},
|
||||||
|
black = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/leo/.local/share/nvim/site/pack/packer/start/black",
|
||||||
|
url = "https://github.com/psf/black"
|
||||||
|
},
|
||||||
["coc.nvim"] = {
|
["coc.nvim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/leo/.local/share/nvim/site/pack/packer/start/coc.nvim",
|
path = "/home/leo/.local/share/nvim/site/pack/packer/start/coc.nvim",
|
||||||
|
@ -82,7 +87,7 @@ _G.packer_plugins = {
|
||||||
["lualine.nvim"] = {
|
["lualine.nvim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/leo/.local/share/nvim/site/pack/packer/start/lualine.nvim",
|
path = "/home/leo/.local/share/nvim/site/pack/packer/start/lualine.nvim",
|
||||||
url = "https://github.com/hoob3rt/lualine.nvim"
|
url = "https://github.com/nvim-lualine/lualine.nvim"
|
||||||
},
|
},
|
||||||
["nginx.vim"] = {
|
["nginx.vim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
|
@ -95,7 +100,7 @@ _G.packer_plugins = {
|
||||||
url = "https://github.com/neovim/nvim-lspconfig"
|
url = "https://github.com/neovim/nvim-lspconfig"
|
||||||
},
|
},
|
||||||
["nvim-mapper"] = {
|
["nvim-mapper"] = {
|
||||||
config = { "\27LJ\1\2=\0\0\2\0\3\0\a4\0\0\0%\1\1\0>\0\2\0027\0\2\0002\1\0\0>\0\2\1G\0\1\0\nsetup\16nvim-mapper\frequire\0" },
|
config = { "\27LJ\2\n=\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\16nvim-mapper\frequire\0" },
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/leo/.local/share/nvim/site/pack/packer/start/nvim-mapper",
|
path = "/home/leo/.local/share/nvim/site/pack/packer/start/nvim-mapper",
|
||||||
url = "https://github.com/lazytanuki/nvim-mapper"
|
url = "https://github.com/lazytanuki/nvim-mapper"
|
||||||
|
@ -136,7 +141,7 @@ _G.packer_plugins = {
|
||||||
url = "https://github.com/nvim-lua/popup.nvim"
|
url = "https://github.com/nvim-lua/popup.nvim"
|
||||||
},
|
},
|
||||||
["telescope.nvim"] = {
|
["telescope.nvim"] = {
|
||||||
config = { "\27LJ\1\2K\0\0\2\0\4\0\a4\0\0\0%\1\1\0>\0\2\0027\0\2\0%\1\3\0>\0\2\1G\0\1\0\vmapper\19load_extension\14telescope\frequire\0" },
|
config = { "\27LJ\2\nK\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0'\2\3\0B\0\2\1K\0\1\0\vmapper\19load_extension\14telescope\frequire\0" },
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/leo/.local/share/nvim/site/pack/packer/start/telescope.nvim",
|
path = "/home/leo/.local/share/nvim/site/pack/packer/start/telescope.nvim",
|
||||||
url = "https://github.com/nvim-telescope/telescope.nvim"
|
url = "https://github.com/nvim-telescope/telescope.nvim"
|
||||||
|
@ -161,11 +166,6 @@ _G.packer_plugins = {
|
||||||
path = "/home/leo/.local/share/nvim/site/pack/packer/start/vim-maximizer",
|
path = "/home/leo/.local/share/nvim/site/pack/packer/start/vim-maximizer",
|
||||||
url = "https://github.com/szw/vim-maximizer"
|
url = "https://github.com/szw/vim-maximizer"
|
||||||
},
|
},
|
||||||
["vim-sandwich"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/home/leo/.local/share/nvim/site/pack/packer/start/vim-sandwich",
|
|
||||||
url = "https://github.com/machakann/vim-sandwich"
|
|
||||||
},
|
|
||||||
["zig.vim"] = {
|
["zig.vim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/leo/.local/share/nvim/site/pack/packer/start/zig.vim",
|
path = "/home/leo/.local/share/nvim/site/pack/packer/start/zig.vim",
|
||||||
|
@ -174,14 +174,14 @@ _G.packer_plugins = {
|
||||||
}
|
}
|
||||||
|
|
||||||
time([[Defining packer_plugins]], false)
|
time([[Defining packer_plugins]], false)
|
||||||
-- Config for: telescope.nvim
|
|
||||||
time([[Config for telescope.nvim]], true)
|
|
||||||
try_loadstring("\27LJ\1\2K\0\0\2\0\4\0\a4\0\0\0%\1\1\0>\0\2\0027\0\2\0%\1\3\0>\0\2\1G\0\1\0\vmapper\19load_extension\14telescope\frequire\0", "config", "telescope.nvim")
|
|
||||||
time([[Config for telescope.nvim]], false)
|
|
||||||
-- Config for: nvim-mapper
|
-- Config for: nvim-mapper
|
||||||
time([[Config for nvim-mapper]], true)
|
time([[Config for nvim-mapper]], true)
|
||||||
try_loadstring("\27LJ\1\2=\0\0\2\0\3\0\a4\0\0\0%\1\1\0>\0\2\0027\0\2\0002\1\0\0>\0\2\1G\0\1\0\nsetup\16nvim-mapper\frequire\0", "config", "nvim-mapper")
|
try_loadstring("\27LJ\2\n=\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\16nvim-mapper\frequire\0", "config", "nvim-mapper")
|
||||||
time([[Config for nvim-mapper]], false)
|
time([[Config for nvim-mapper]], false)
|
||||||
|
-- Config for: telescope.nvim
|
||||||
|
time([[Config for telescope.nvim]], true)
|
||||||
|
try_loadstring("\27LJ\2\nK\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0'\2\3\0B\0\2\1K\0\1\0\vmapper\19load_extension\14telescope\frequire\0", "config", "telescope.nvim")
|
||||||
|
time([[Config for telescope.nvim]], false)
|
||||||
if should_profile then save_profiles() end
|
if should_profile then save_profiles() end
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user