.
This commit is contained in:
@@ -87,7 +87,7 @@
|
||||
autocmd! ColorScheme * hi clear CursorLine
|
||||
augroup END
|
||||
|
||||
set cmdheight=1 " get rid of the extra useless line at the bottom(not working, probably a plugin is changing the value)
|
||||
set cmdheight=1 " get rid of the extra useless line at the bottom(if not working, probably a plugin is changing the value)
|
||||
|
||||
"highlight clear SignColumn " SignColumn should match background
|
||||
"highlight clear LineNr " Current line number row will have same background color in relative mode
|
||||
@@ -157,21 +157,21 @@
|
||||
noremap k gk
|
||||
|
||||
" Stupid shift key fixes
|
||||
if !exists('g:spf13_no_keyfixes')
|
||||
if has("user_commands")
|
||||
command! -bang -nargs=* -complete=file E e<bang> <args>
|
||||
command! -bang -nargs=* -complete=file W w<bang> <args>
|
||||
command! -bang -nargs=* -complete=file Wq wq<bang> <args>
|
||||
command! -bang -nargs=* -complete=file WQ wq<bang> <args>
|
||||
command! -bang Wa wa<bang>
|
||||
command! -bang WA wa<bang>
|
||||
command! -bang Q q<bang>
|
||||
command! -bang QA qa<bang>
|
||||
command! -bang Qa qa<bang>
|
||||
endif
|
||||
" if !exists('g:spf13_no_keyfixes')
|
||||
" if has("user_commands")
|
||||
" command! -bang -nargs=* -complete=file E e<bang> <args>
|
||||
" command! -bang -nargs=* -complete=file W w<bang> <args>
|
||||
" command! -bang -nargs=* -complete=file Wq wq<bang> <args>
|
||||
" command! -bang -nargs=* -complete=file WQ wq<bang> <args>
|
||||
" command! -bang Wa wa<bang>
|
||||
" command! -bang WA wa<bang>
|
||||
" command! -bang Q q<bang>
|
||||
" command! -bang QA qa<bang>
|
||||
" command! -bang Qa qa<bang>
|
||||
" endif
|
||||
|
||||
cmap Tabe tabe
|
||||
endif
|
||||
" cmap Tabe tabe
|
||||
" endif
|
||||
|
||||
" Yank from the cursor to the end of the line, to be consistent with C and D.
|
||||
nnoremap Y y$
|
||||
@@ -213,17 +213,7 @@
|
||||
map zh zH
|
||||
|
||||
" Easier formatting
|
||||
nnoremap <silent> <leader>q gwip
|
||||
|
||||
" Plugins {
|
||||
|
||||
" AutoCloseTag {
|
||||
" Make it so AutoCloseTag works for xml and xhtml files as well
|
||||
au FileType xhtml,xml ru ftplugin/html/autoclosetag.vim
|
||||
nmap <Leader>ac <Plug>ToggleAutoCloseMappings
|
||||
" }
|
||||
|
||||
" }
|
||||
" nnoremap <silent> <leader>q gwip
|
||||
|
||||
" Functions {
|
||||
|
||||
|
||||
+30
-25
@@ -96,6 +96,9 @@
|
||||
endif
|
||||
if g:vim_version >= 0.7
|
||||
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
||||
|
||||
" comment out this plugin if the machine doesn't have required
|
||||
" font install
|
||||
Plug 'nvim-tree/nvim-web-devicons'
|
||||
endif
|
||||
if g:vim_version >= 0.8
|
||||
@@ -131,10 +134,6 @@ if g:vim_type == 'nvim'
|
||||
if g:vim_version >= 0.7
|
||||
" nvim-treesitter/nvim-treesitter {
|
||||
|
||||
if filereadable(expand(g:dotfile_path . '.vimrc.lua'))
|
||||
execute('source ' . g:dotfile_path . '/.vimrc.lua')
|
||||
endif
|
||||
|
||||
" }
|
||||
endif
|
||||
endif
|
||||
@@ -187,11 +186,13 @@ endif
|
||||
let g:bufferline_modified = '+'
|
||||
|
||||
" scrolling with fixed current buffer position
|
||||
let g:bufferline_rotate = 1
|
||||
let g:bufferline_rotate = 0
|
||||
|
||||
let g:bufferline_active_buffer_left = ''
|
||||
let g:bufferline_active_buffer_right = ''
|
||||
let g:bufferline_fixed_index = -1
|
||||
let g:bufferline_inactive_highlight = 'StatusLineNC'
|
||||
let g:bufferline_active_highlight = 'StatusLine'
|
||||
|
||||
" }
|
||||
|
||||
@@ -231,10 +232,6 @@ endif
|
||||
" nvim-tree.lua {
|
||||
if g:vim_type == 'nvim' && isdirectory(expand(plugin_dir . "/nvim-tree.lua"))
|
||||
|
||||
|
||||
nnoremap <leader>e :NvimTreeFindFileToggle<CR>
|
||||
nnoremap <leader>r :NvimTreeRefresh<CR>
|
||||
|
||||
" Hide vim bottom statusline
|
||||
" autocmd FileType NvimTree setlocal noshowmode noruler laststatus=0 noshowcmd
|
||||
set noshowmode noruler laststatus=0 noshowcmd
|
||||
@@ -592,34 +589,42 @@ endif
|
||||
" {
|
||||
|
||||
" Toggle dark/light theme
|
||||
noremap <leader>bg :call ToggleBG()<CR>
|
||||
noremap <silent> <leader>bg :call ToggleBG()<CR>
|
||||
|
||||
" Toggle transparent background
|
||||
noremap <leader>tb :call ToggleTransparent()<CR>
|
||||
noremap <silent> <leader>tb :call ToggleTransparent()<CR>
|
||||
|
||||
" Buffer navigation
|
||||
nnoremap <space>q :bprevious<CR>
|
||||
nnoremap <space>e :bnext<CR>
|
||||
nnoremap <silent> <space>q :bprevious<CR>
|
||||
nnoremap <silent> <space>e :bnext<CR>
|
||||
|
||||
" leader s change all occurence
|
||||
nnoremap <Leader>s :%s/\<<C-r><C-w>\>/
|
||||
nnoremap <silent> <Leader>s :%s/\<<C-r><C-w>\>/
|
||||
|
||||
" leader num change tab
|
||||
nnoremap <Leader>1 :b1<CR>
|
||||
nnoremap <Leader>2 :b2<CR>
|
||||
nnoremap <Leader>3 :b3<CR>
|
||||
nnoremap <Leader>4 :b4<CR>
|
||||
nnoremap <Leader>5 :b5<CR>
|
||||
nnoremap <Leader>6 :b6<CR>
|
||||
nnoremap <Leader>7 :b7<CR>
|
||||
nnoremap <Leader>8 :b8<CR>
|
||||
nnoremap <Leader>9 :b9<CR>
|
||||
" only for vim or nvim without lualine
|
||||
if g:vim_type == 'vim' || (g:vim_type == 'nvim' && g:vim_version < 0.5)
|
||||
nnoremap <Leader>1 :b1<CR>
|
||||
nnoremap <Leader>2 :b2<CR>
|
||||
nnoremap <Leader>3 :b3<CR>
|
||||
nnoremap <Leader>4 :b4<CR>
|
||||
nnoremap <Leader>5 :b5<CR>
|
||||
nnoremap <Leader>6 :b6<CR>
|
||||
nnoremap <Leader>7 :b7<CR>
|
||||
nnoremap <Leader>8 :b8<CR>
|
||||
nnoremap <Leader>9 :b9<CR>
|
||||
end
|
||||
|
||||
" split window comform with other window management shortcuts
|
||||
nnoremap <C-w>% :vsplit<CR>
|
||||
nnoremap <C-w>" :split<CR>
|
||||
nnoremap <silent> <C-w>% :vsplit<CR>
|
||||
nnoremap <silent> <C-w>" :split<CR>
|
||||
" }
|
||||
"
|
||||
" Lua configuration
|
||||
if g:vim_type == 'nvim' && filereadable(expand(g:dotfile_path . '.vimrc.lua'))
|
||||
execute('source ' . g:dotfile_path . '/.vimrc.lua')
|
||||
endif
|
||||
"
|
||||
" Useful_Info{
|
||||
" show mapping info
|
||||
" :verbose map ,cf
|
||||
|
||||
+50
-30
@@ -4,6 +4,21 @@ vim_version_minor = vim_version['minor']
|
||||
-- debug
|
||||
-- print(vim.inspect(version))
|
||||
|
||||
if vim_version_minor >= 5 then
|
||||
|
||||
require("transparent").setup({
|
||||
enable = true, -- boolean: enable transparent
|
||||
extra_groups = { -- table/string: additional groups that should be cleared
|
||||
-- In particular, when you set it to 'all', that means all available groups
|
||||
|
||||
"NvimTreeNormal",
|
||||
"VertSplit",
|
||||
},
|
||||
exclude = {}, -- table: groups you don't want to clear
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
if vim_version_minor >= 7 then
|
||||
|
||||
require('nvim-treesitter.configs').setup {
|
||||
@@ -21,14 +36,30 @@ end
|
||||
|
||||
if vim_version_minor >= 5 then
|
||||
|
||||
for i=1,9 do
|
||||
vim.api.nvim_set_keymap('n', '<Leader>'..i, ':LualineBuffersJump '..i..'<CR>', { noremap = true, silent = true })
|
||||
-- :nnoremap <silent> <Leader>1 :LualineBuffersJump 1<CR>
|
||||
end
|
||||
|
||||
local disabled_filetypes_data = {}
|
||||
if vim_version_minor < 7 then
|
||||
-- globalstatus only work for nvim >= 0.7
|
||||
disabled_filetypes_data = { -- Filetypes to disable lualine for.
|
||||
statusline = {}, -- only ignores the ft for statusline.
|
||||
winbar = {}, -- only ignores the ft for winbar.
|
||||
'NvimTree'
|
||||
}
|
||||
end
|
||||
|
||||
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'
|
||||
},
|
||||
-- theme = 'ayu', -- lualine theme
|
||||
always_divide_middle = false, -- When set to true, left sections i.e. 'a','b' and 'c'
|
||||
-- can't take over the entire statusline even
|
||||
-- if neither of 'x', 'y' or 'z' are present.
|
||||
globalstatus = true,
|
||||
disabled_filetypes = disabled_filetypes_data,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {'mode'},
|
||||
@@ -36,43 +67,30 @@ if vim_version_minor >= 5 then
|
||||
lualine_c = {
|
||||
{
|
||||
'buffers',
|
||||
mode = 4,
|
||||
mode = 2,
|
||||
filetype_names = {
|
||||
TelescopePrompt = 'Telescope',
|
||||
dashboard = 'Dashboard',
|
||||
packer = 'Packer',
|
||||
fzf = 'FZF',
|
||||
alpha = 'Alpha',
|
||||
NvimTree = 'NvimTree'
|
||||
NvimTree = ''
|
||||
},
|
||||
max_length = vim.o.columns * 2 / 3, -- Maximum width of buffers component,
|
||||
-- it can also be a function that returns
|
||||
-- the value of `max_length` dynamically.
|
||||
symbols = {
|
||||
modified = ' ●', -- Text to show when the buffer is modified
|
||||
alternate_file = '', -- Text to show to identify the alternate file
|
||||
directory = '', -- Text to show when the buffer is a directory
|
||||
},
|
||||
}
|
||||
},
|
||||
-- lualine_x = {'encoding', 'fileformat', 'filetype'},
|
||||
lualine_x = {'encoding'},
|
||||
lualine_y = {},
|
||||
lualine_x = {},
|
||||
lualine_y = {'encoding'},
|
||||
lualine_z = {'location'}
|
||||
},
|
||||
-- tabline = {
|
||||
-- lualine_a = {
|
||||
-- {
|
||||
-- 'buffers',
|
||||
-- mode = 4,
|
||||
-- }
|
||||
-- },
|
||||
-- lualine_b = {},
|
||||
-- lualine_c = {},
|
||||
-- lualine_x = {},
|
||||
-- lualine_y = {},
|
||||
-- lualine_z = {'tabs'}
|
||||
-- },
|
||||
-- winbar = {
|
||||
-- lualine_a = {},
|
||||
-- lualine_b = {},
|
||||
-- lualine_c = {'filename'},
|
||||
-- lualine_x = {},
|
||||
-- lualine_y = {},
|
||||
-- lualine_z = {}
|
||||
-- },
|
||||
}
|
||||
|
||||
end
|
||||
@@ -121,6 +139,8 @@ if vim_version_minor >= 8 then
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_set_keymap('n', '<Leader>e', ':NvimTreeFindFileToggle<CR>', { noremap = true, silent = true })
|
||||
|
||||
--
|
||||
-- nvim-tree configuration end
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user