From abac026ed60c42db021d8471fea17a98cc09d2d3 Mon Sep 17 00:00:00 2001 From: Blallo Date: Tue, 22 Feb 2022 00:02:44 +0100 Subject: [PATCH] Chores --- init.lua | 13 ++++++++----- lua/config/theme.lua | 18 ++++++++++++++++-- lua/plugins.lua | 2 ++ plugin/packer_compiled.lua | 32 ++++++++++++++++---------------- 4 files changed, 42 insertions(+), 23 deletions(-) diff --git a/init.lua b/init.lua index 61e832b..38994fb 100644 --- a/init.lua +++ b/init.lua @@ -5,8 +5,8 @@ local cmd = vim.cmd local o, wo, bo = vim.o, vim.wo, vim.bo local utils = require 'config.utils' local opt = utils.opt -local autocmd = utils.autocmd -local map = utils.map +-- local autocmd = utils.autocmd +-- local map = utils.map local let = utils.let 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! 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 require('config.theme') @@ -97,7 +100,7 @@ Mapper = require("nvim-mapper") local map = Mapper.map -- - Telescope-related -local opts = {noremap = true, silent = true} +local opts = { noremap = true, silent = true } map('n', 'ff', 'Telescope find_files', opts, "Telescope", "find_files", "Find files from current position") map('n', 'fg', 'Telescope git_files', opts, "Telescope", "git_files", "Find git-tracked files") map('n', 'fb', 'Telescope buffers', opts, "Telescope", "buffers", "Search in current opened buffers") @@ -113,7 +116,7 @@ map('n', 'ld', 'Telescope lsp_definitions', opts, "Telescope", map('n', 'ls', 'Telescope lsp_document_symbols', opts, "Telescope", "lsp_document_symbols", "Show symbols in document using LSP") -- Undo tree -map('n', 'u', 'UndotreeToggleUndotreeFocus', {noremap = true}, "UndoTree", "undo_tree_toggle", "Toggle UndoTree browser") +map('n', 'u', 'UndotreeToggleUndotreeFocus', { noremap = true }, "UndoTree", "undo_tree_toggle", "Toggle UndoTree browser") -- Split maximizer map('n', 'mm', 'MaximizerToggle', opts, "MaximizerToggle", "maximizer_toggle_n", "Toggle maximal view of current split") @@ -144,7 +147,7 @@ map('n', '', 'bnext', {}, "Movement", "go_to_next_buf", "S map('n', '\\', 'bprev', {}, "Movement", "go_to_prev_buf", "Switch to the previous buffer") -- Move selection around -cmd ([[ +cmd([[ nnoremap :m .+1== nnoremap :m .-2== inoremap :m .+1==gi diff --git a/lua/config/theme.lua b/lua/config/theme.lua index 0915caa..958522c 100644 --- a/lua/config/theme.lua +++ b/lua/config/theme.lua @@ -23,13 +23,25 @@ local let = utils.let -- let('g', 'airline_powerline_fonts ', 1) -- github-theme +lualine_c = {function() + return vim.fn['nvim_treesitter#statusline'](90) +end} require('lualine').setup({ options = { - theme = "tokionight" + theme = "tokyonight", -- theme = "github" -- section_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", -- 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 cmd[[colorscheme tokyonight]] diff --git a/lua/plugins.lua b/lua/plugins.lua index 25cb5a6..d2b5d10 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -1,4 +1,6 @@ local packer = nil + +vim.lsp.set_log_level("debug") local function init() if packer == nil then packer = require 'packer' diff --git a/plugin/packer_compiled.lua b/plugin/packer_compiled.lua index a0038b5..356544c 100644 --- a/plugin/packer_compiled.lua +++ b/plugin/packer_compiled.lua @@ -44,8 +44,8 @@ local function save_profiles(threshold) end 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 install_cpath_pattern = "/home/leo/.cache/nvim/packer_hererocks/2.0.5/lib/lua/5.1/?.so" +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.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 @@ -57,7 +57,7 @@ end time([[Luarocks path setup]], false) time([[try_loadstring definition]], true) 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 vim.schedule(function() 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", 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"] = { loaded = true, path = "/home/leo/.local/share/nvim/site/pack/packer/start/coc.nvim", @@ -82,7 +87,7 @@ _G.packer_plugins = { ["lualine.nvim"] = { loaded = true, 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"] = { loaded = true, @@ -95,7 +100,7 @@ _G.packer_plugins = { url = "https://github.com/neovim/nvim-lspconfig" }, ["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, path = "/home/leo/.local/share/nvim/site/pack/packer/start/nvim-mapper", url = "https://github.com/lazytanuki/nvim-mapper" @@ -136,7 +141,7 @@ _G.packer_plugins = { url = "https://github.com/nvim-lua/popup.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, path = "/home/leo/.local/share/nvim/site/pack/packer/start/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", 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"] = { loaded = true, path = "/home/leo/.local/share/nvim/site/pack/packer/start/zig.vim", @@ -174,14 +174,14 @@ _G.packer_plugins = { } 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 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) +-- 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 end)