From cd55da86b1f4185ddcaffd69aed9b34a7149ff83 Mon Sep 17 00:00:00 2001 From: Nachuan Tang Date: Sat, 4 Feb 2023 19:16:54 -0500 Subject: [PATCH] replace some plugins for nvim --- .vimrc | 6 +++-- .vimrc.bundles | 9 ++++++-- .vimrc.lua | 60 ++++++++++++++++++++++++++++++++++++-------------- 3 files changed, 55 insertions(+), 20 deletions(-) diff --git a/.vimrc b/.vimrc index be3ba9f..0c90f72 100644 --- a/.vimrc +++ b/.vimrc @@ -78,8 +78,8 @@ " Vim UI { " - set tabpagemax=15 " Only show 15 tabs - set showmode " Display the current mode + " set tabpagemax=15 " Only show 15 tabs + " set showmode " Display the current mode set cursorline " Highlight current line set cmdheight=1 " get rid of the extra useless line at the bottom(not working, probably a plugin is changing the value) @@ -91,6 +91,7 @@ set ruler " Show the ruler set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%) " A ruler on steroids set showcmd " Show partial commands in status line and + endif set backspace=indent,eol,start " Backspace for dummies @@ -109,6 +110,7 @@ set scrolloff=5 " Minimum lines to keep above and below cursor set sidescrolloff=5 " Minimum lines to keep at the left or right of the cursor + " } " Formatting { diff --git a/.vimrc.bundles b/.vimrc.bundles index 6d1a19d..aa83a22 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -229,8 +229,11 @@ endif nnoremap e :NvimTreeFindFileToggle nnoremap r :NvimTreeRefresh - " nnoremap e :NvimTreeFindFile + " Hide vim bottom statusline + " autocmd FileType NvimTree setlocal noshowmode noruler laststatus=0 noshowcmd + set noshowmode noruler laststatus=0 noshowcmd + " autocmd BufRead,BufNewFile NvimTree set laststatus=0 " This will work instead endif " } @@ -239,6 +242,7 @@ endif " } "else " vim-airline { + if g:vim_type == 'vim' && isdirectory(expand(plugin_dir . "/airline")) " Set configuration options for the statusline plugin vim-airline. " Use the powerline theme and optionally enable powerline symbols. let g:airline_section_b = '' @@ -276,6 +280,7 @@ endif if isdirectory(expand(plugin_dir . "/vim-airline-themes/")) "let g:airline_theme = 'solarized' endif + endif " } "endif @@ -386,7 +391,7 @@ endif " Currently only support airline function! SetAirlineTheme(theme) if g:vim_type == 'nvim' && g:vim_version >= 0.5 - execute('AirlineTheme ' . a:theme) + "execute('AirlineTheme ' . a:theme) else execute('AirlineTheme ' . a:theme) endif diff --git a/.vimrc.lua b/.vimrc.lua index db50cb1..b5ff333 100644 --- a/.vimrc.lua +++ b/.vimrc.lua @@ -11,6 +11,14 @@ require('nvim-treesitter.configs').setup { } require('lualine').setup { + options = { + theme = 'auto', -- lualine theme + disabled_filetypes = { -- Filetypes to disable lualine for. + statusline = {}, -- only ignores the ft for statusline. + winbar = {}, -- only ignores the ft for winbar. + 'NvimTree' + }, + }, sections = { lualine_a = {'mode'}, lualine_b = {}, @@ -18,6 +26,14 @@ require('lualine').setup { { 'buffers', mode = 4, + filetype_names = { + TelescopePrompt = 'Telescope', + dashboard = 'Dashboard', + packer = 'Packer', + fzf = 'FZF', + alpha = 'Alpha', + NvimTree = 'NvimTree' + }, } }, -- lualine_x = {'encoding', 'fileformat', 'filetype'}, @@ -60,23 +76,35 @@ vim.opt.termguicolors = true -- setup with some options require("nvim-tree").setup({ - sort_by = "case_sensitive", - view = { - width = 30, - mappings = { - list = { - { key = "C-[", action = "dir_up" }, - { key = "C-]", action = "cd" }, - { key = "", action = "toggle_file_info" }, - }, + sort_by = "case_sensitive", + view = { + width = 30, + mappings = { + list = { + { key = "C-[", action = "dir_up" }, + { key = "C-]", action = "cd" }, + { key = "", action = "toggle_file_info" }, + }, + }, + }, + renderer = { + group_empty = true, + }, + filters = { + dotfiles = false, + }, + actions = { + open_file = { + quit_on_open = true, + resize_window = true, + window_picker = { + exclude = { + filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" }, + buftype = { "nofile", "terminal", "help" }, + }, + }, + }, }, - }, - renderer = { - group_empty = true, - }, - filters = { - dotfiles = false, - }, }) --