Change to lualine and neotree
This commit is contained in:
parent
f4d229524b
commit
fafcee66b1
|
@ -70,7 +70,7 @@ set background=light
|
|||
set completeopt=menu,menuone,noselect
|
||||
set tabstop=4
|
||||
set shiftwidth=0
|
||||
set number
|
||||
set number relativenumber
|
||||
set mouse=a
|
||||
set cursorline
|
||||
set noexpandtab
|
||||
|
@ -84,14 +84,8 @@ set textwidth=72
|
|||
colorscheme gruvbox
|
||||
" hi Normal guibg=NONE ctermbg=NONE
|
||||
|
||||
let g:airline_theme= 'base16_gruvbox_light_soft'
|
||||
let g:airline_powerline_fonts = 1
|
||||
|
||||
|
||||
tnoremap <C-A-n> <cmd>NnnExplorer<CR>
|
||||
nnoremap <C-A-n> <cmd>NnnExplorer %:p:h<CR>
|
||||
tnoremap <C-A-p> <cmd>NnnPicker<CR>
|
||||
nnoremap <C-A-p> <cmd>NnnPicker<CR>
|
||||
tnoremap <C-A-n> <cmd>Neotree toggle<CR>
|
||||
nnoremap <C-A-n> <cmd>Neotree toggle reveal %:p:h<CR>
|
||||
|
||||
" Use <Tab> and <S-Tab> to navigate through popup menu
|
||||
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||||
|
@ -109,3 +103,4 @@ let g:neovide_floating_blur_amount_x = 2.0
|
|||
let g:neovide_floating_blur_amount_y = 2.0
|
||||
let g:neovide_floating_opacity = 60
|
||||
|
||||
set guifont=SFMono\ Nerd\ Font
|
||||
|
|
|
@ -6,6 +6,8 @@ vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
|||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
||||
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
||||
|
||||
local navic = require("nvim-navic")
|
||||
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
local on_attach = function(client, bufnr)
|
||||
|
@ -32,6 +34,10 @@ local on_attach = function(client, bufnr)
|
|||
vim.keymap.set('n', '<space>f', function ()
|
||||
vim.lsp.buf.format({ async = true })
|
||||
end, bufopts)
|
||||
|
||||
if client.server_capabilities.documentSymbolProvider then
|
||||
navic.attach(client, bufnr)
|
||||
end
|
||||
end
|
||||
|
||||
local lsp_flags = {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
vim.cmd [[packadd packer.nvim]]
|
||||
|
||||
|
||||
require('packer').startup(function(use)
|
||||
use 'wbthomason/packer.nvim'
|
||||
|
||||
|
@ -27,19 +28,38 @@ require('packer').startup(function(use)
|
|||
'L3MON4D3/LuaSnip',
|
||||
'saadparwaiz1/cmp_luasnip'
|
||||
}
|
||||
|
||||
use {
|
||||
"luukvbaal/nnn.nvim",
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
requires = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||
"MunifTanjim/nui.nvim",
|
||||
}
|
||||
}
|
||||
|
||||
use {
|
||||
'romgrk/barbar.nvim',
|
||||
requires = {'kyazdani42/nvim-web-devicons'},
|
||||
"folke/trouble.nvim"
|
||||
}
|
||||
|
||||
use { 'onsails/lspkind.nvim' }
|
||||
use 'f-person/auto-dark-mode.nvim'
|
||||
|
||||
use 'vim-airline/vim-airline'
|
||||
use 'vim-airline/vim-airline-themes'
|
||||
use {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
requires = { 'nvim-tree/nvim-web-devicons', opt = true }
|
||||
}
|
||||
|
||||
use {
|
||||
"SmiteshP/nvim-navic",
|
||||
requires = "neovim/nvim-lspconfig"
|
||||
}
|
||||
|
||||
--use 'vim-airline/vim-airline'
|
||||
--use 'vim-airline/vim-airline-themes'
|
||||
|
||||
use 'lervag/vimtex'
|
||||
end)
|
||||
|
||||
require("gruvbox").setup({
|
||||
|
@ -95,25 +115,6 @@ require'nvim-treesitter.configs'.setup {
|
|||
}
|
||||
|
||||
|
||||
local cfg = {
|
||||
auto_open = {
|
||||
-- setup = "explorer", -- or "explorer" / "picker", auto open on setup function
|
||||
--empty = false, -- only auto open on empty buffer
|
||||
},
|
||||
--auto_close = false, -- close tabpage/nvim when nnn is last window
|
||||
--replace_netrw = nil, -- or "explorer" / "picker"
|
||||
windownav = { -- window movement mappings to navigate out of nnn
|
||||
left = "<C-h>",
|
||||
right = "<C-l>",
|
||||
next = "<C-w>",
|
||||
prev = "<C-W>",
|
||||
},
|
||||
--buflisted = false, -- whether or not nnn buffers show up in the bufferlist
|
||||
--quitcd = "tcd", -- or "cd" / "lcd", command to run if quitcd file is found
|
||||
}
|
||||
|
||||
require('nnn').setup(cfg)
|
||||
|
||||
local auto_dark_mode = require('auto-dark-mode')
|
||||
|
||||
auto_dark_mode.setup({
|
||||
|
@ -121,30 +122,134 @@ auto_dark_mode.setup({
|
|||
set_dark_mode = function()
|
||||
vim.api.nvim_set_option('background', 'dark')
|
||||
vim.cmd('colorscheme gruvbox')
|
||||
vim.cmd('AirlineTheme base16_gruvbox_dark_soft')
|
||||
vim.cmd("let g:neovide_background_color = '#32302f'.printf('%x', float2nr(255 * g:transparency))");
|
||||
--vim.cmd('hi Normal guibg=NONE ctermbg=NONE')
|
||||
end,
|
||||
set_light_mode = function()
|
||||
vim.api.nvim_set_option('background', 'light')
|
||||
vim.cmd('colorscheme gruvbox')
|
||||
vim.cmd('AirlineTheme base16_gruvbox_light_soft')
|
||||
vim.cmd("let g:neovide_background_color = '#f2e5bc'.printf('%x', float2nr(255 * g:transparency))");
|
||||
--vim.cmd('hi Normal guibg=NONE ctermbg=NONE')
|
||||
end,
|
||||
})
|
||||
auto_dark_mode.init()
|
||||
|
||||
require'bufferline'.setup {
|
||||
icons = {
|
||||
diagnostics = {
|
||||
[vim.diagnostic.severity.ERROR] = {enabled = true, icon = ''},
|
||||
[vim.diagnostic.severity.WARN] = {enabled = true, icon = ''},
|
||||
[vim.diagnostic.severity.INFO] = {enabled = true, icon = ''},
|
||||
[vim.diagnostic.severity.HINT] = {enabled = true},
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'gruvbox',
|
||||
component_separators = { left = '', right = ''},
|
||||
section_separators = { left = '', right = ''},
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {
|
||||
"help",
|
||||
"startify",
|
||||
"dashboard",
|
||||
"packer",
|
||||
"neogitstatus",
|
||||
"NvimTree",
|
||||
"Trouble",
|
||||
"alpha",
|
||||
"lir",
|
||||
"Outline",
|
||||
"spectre_panel",
|
||||
"toggleterm",
|
||||
},
|
||||
},
|
||||
separator = {left = '', right = ''},
|
||||
inactive = { separator = {left = '', right = ''}},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
}
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {'mode'},
|
||||
lualine_b = {'diff', 'diagnostics'},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'encoding', 'fileformat', 'filetype'},
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location'}
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'location'},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {
|
||||
lualine_a = {
|
||||
{
|
||||
"buffers",
|
||||
mode = 2,
|
||||
}
|
||||
},
|
||||
lualine_b = {
|
||||
"branch"
|
||||
},
|
||||
lualine_c = {'hostname'},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {'tabs', 'datetime'},
|
||||
},
|
||||
winbar = {
|
||||
lualine_a = {'searchcount'},
|
||||
lualine_b = {},
|
||||
lualine_c = {
|
||||
"filename",
|
||||
"navic",
|
||||
},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
inactive_winbar = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {
|
||||
"filename",
|
||||
"navic"
|
||||
},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
extensions = {}
|
||||
}
|
||||
require'nvim-navic'.setup {
|
||||
icons = {
|
||||
File = ' ',
|
||||
Module = ' ',
|
||||
Namespace = ' ',
|
||||
Package = ' ',
|
||||
Class = ' ',
|
||||
Method = ' ',
|
||||
Property = ' ',
|
||||
Field = ' ',
|
||||
Constructor = ' ',
|
||||
Enum = ' ',
|
||||
Interface = ' ',
|
||||
Function = ' ',
|
||||
Variable = ' ',
|
||||
Constant = ' ',
|
||||
String = ' ',
|
||||
Number = ' ',
|
||||
Boolean = ' ',
|
||||
Array = ' ',
|
||||
Object = ' ',
|
||||
Key = ' ',
|
||||
Null = ' ',
|
||||
EnumMember = ' ',
|
||||
Struct = ' ',
|
||||
Event = ' ',
|
||||
Operator = ' ',
|
||||
TypeParameter = ' ',
|
||||
},
|
||||
separator = ' ',
|
||||
}
|
||||
|
||||
|
|
|
@ -9,23 +9,26 @@ 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
|
||||
_G._packer = _G._packer or {}
|
||||
_G._packer.inside_compile = true
|
||||
|
||||
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
|
||||
else
|
||||
time = function(chunk, start) 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
|
||||
|
@ -38,8 +41,10 @@ local function save_profiles(threshold)
|
|||
results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms'
|
||||
end
|
||||
end
|
||||
if threshold then
|
||||
table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)')
|
||||
end
|
||||
|
||||
_G._packer = _G._packer or {}
|
||||
_G._packer.profile_output = results
|
||||
end
|
||||
|
||||
|
@ -124,6 +129,11 @@ _G.packer_plugins = {
|
|||
path = "/Users/nullobsi/Library/Application Support/nvim/site/pack/packer/start/lspkind.nvim",
|
||||
url = "https://github.com/onsails/lspkind.nvim"
|
||||
},
|
||||
["lualine.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/nullobsi/Library/Application Support/nvim/site/pack/packer/start/lualine.nvim",
|
||||
url = "https://github.com/nvim-lualine/lualine.nvim"
|
||||
},
|
||||
["mason-lspconfig.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/nullobsi/Library/Application Support/nvim/site/pack/packer/start/mason-lspconfig.nvim",
|
||||
|
@ -134,10 +144,15 @@ _G.packer_plugins = {
|
|||
path = "/Users/nullobsi/Library/Application Support/nvim/site/pack/packer/start/mason.nvim",
|
||||
url = "https://github.com/williamboman/mason.nvim"
|
||||
},
|
||||
["nnn.nvim"] = {
|
||||
["neo-tree.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/nullobsi/Library/Application Support/nvim/site/pack/packer/start/nnn.nvim",
|
||||
url = "https://github.com/luukvbaal/nnn.nvim"
|
||||
path = "/Users/nullobsi/Library/Application Support/nvim/site/pack/packer/start/neo-tree.nvim",
|
||||
url = "https://github.com/nvim-neo-tree/neo-tree.nvim"
|
||||
},
|
||||
["nui.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/nullobsi/Library/Application Support/nvim/site/pack/packer/start/nui.nvim",
|
||||
url = "https://github.com/MunifTanjim/nui.nvim"
|
||||
},
|
||||
["nvim-cmp"] = {
|
||||
loaded = true,
|
||||
|
@ -149,6 +164,11 @@ _G.packer_plugins = {
|
|||
path = "/Users/nullobsi/Library/Application Support/nvim/site/pack/packer/start/nvim-lspconfig",
|
||||
url = "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
["nvim-navic"] = {
|
||||
loaded = true,
|
||||
path = "/Users/nullobsi/Library/Application Support/nvim/site/pack/packer/start/nvim-navic",
|
||||
url = "https://github.com/SmiteshP/nvim-navic"
|
||||
},
|
||||
["nvim-treesitter"] = {
|
||||
loaded = true,
|
||||
path = "/Users/nullobsi/Library/Application Support/nvim/site/pack/packer/start/nvim-treesitter",
|
||||
|
@ -157,26 +177,38 @@ _G.packer_plugins = {
|
|||
["nvim-web-devicons"] = {
|
||||
loaded = true,
|
||||
path = "/Users/nullobsi/Library/Application Support/nvim/site/pack/packer/start/nvim-web-devicons",
|
||||
url = "https://github.com/kyazdani42/nvim-web-devicons"
|
||||
url = "https://github.com/nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
["packer.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/nullobsi/Library/Application Support/nvim/site/pack/packer/start/packer.nvim",
|
||||
url = "https://github.com/wbthomason/packer.nvim"
|
||||
},
|
||||
["vim-airline"] = {
|
||||
["plenary.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/nullobsi/Library/Application Support/nvim/site/pack/packer/start/vim-airline",
|
||||
url = "https://github.com/vim-airline/vim-airline"
|
||||
path = "/Users/nullobsi/Library/Application Support/nvim/site/pack/packer/start/plenary.nvim",
|
||||
url = "https://github.com/nvim-lua/plenary.nvim"
|
||||
},
|
||||
["vim-airline-themes"] = {
|
||||
["trouble.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/nullobsi/Library/Application Support/nvim/site/pack/packer/start/vim-airline-themes",
|
||||
url = "https://github.com/vim-airline/vim-airline-themes"
|
||||
path = "/Users/nullobsi/Library/Application Support/nvim/site/pack/packer/start/trouble.nvim",
|
||||
url = "https://github.com/folke/trouble.nvim"
|
||||
},
|
||||
vimtex = {
|
||||
loaded = true,
|
||||
path = "/Users/nullobsi/Library/Application Support/nvim/site/pack/packer/start/vimtex",
|
||||
url = "https://github.com/lervag/vimtex"
|
||||
}
|
||||
}
|
||||
|
||||
time([[Defining packer_plugins]], false)
|
||||
|
||||
_G._packer.inside_compile = false
|
||||
if _G._packer.needs_bufread == true then
|
||||
vim.cmd("doautocmd BufRead")
|
||||
end
|
||||
_G._packer.needs_bufread = false
|
||||
|
||||
if should_profile then save_profiles() end
|
||||
|
||||
end)
|
||||
|
|
Loading…
Reference in New Issue