From 2b8b39dbc2e08f4c2263435bd9e9754648ffe525 Mon Sep 17 00:00:00 2001 From: jay Date: Fri, 31 Mar 2023 23:01:41 +0800 Subject: [PATCH] update --- ...run_once_after_30_install_tmux_tpm.sh.tmpl | 5 + home/dot_config/nvim/init.vim.tmpl | 131 ++++++++++++++++-- home/dot_tmux.conf | 7 + 3 files changed, 129 insertions(+), 14 deletions(-) create mode 100644 home/.chezmoiscripts/run_once_after_30_install_tmux_tpm.sh.tmpl diff --git a/home/.chezmoiscripts/run_once_after_30_install_tmux_tpm.sh.tmpl b/home/.chezmoiscripts/run_once_after_30_install_tmux_tpm.sh.tmpl new file mode 100644 index 0000000..2667d09 --- /dev/null +++ b/home/.chezmoiscripts/run_once_after_30_install_tmux_tpm.sh.tmpl @@ -0,0 +1,5 @@ +#!/bin/bash + +{{ if .shell.tmux }} +git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm +{{ end }} diff --git a/home/dot_config/nvim/init.vim.tmpl b/home/dot_config/nvim/init.vim.tmpl index 851f72d..f5c65b6 100644 --- a/home/dot_config/nvim/init.vim.tmpl +++ b/home/dot_config/nvim/init.vim.tmpl @@ -54,7 +54,6 @@ Plug 'junegunn/fzf.vim' Plug 'kyazdani42/nvim-web-devicons' " for file icons Plug 'kyazdani42/nvim-tree.lua' -Plug 'vim-airline/vim-airline' Plug 'kien/tabman.vim' " for git @@ -68,12 +67,15 @@ Plug 'inkarkat/vim-mark' Plug 'rking/ag.vim' Plug 'terryma/vim-multiple-cursors' +" Plug 'vim-airline/vim-airline' +Plug 'nvim-lualine/lualine.nvim' + Plug 'lukas-reineke/indent-blankline.nvim' Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'codota/tabnine-nvim', { 'do': './dl_binaries.sh' } -Plug 'rafamadriz/neon' +Plug 'folke/tokyonight.nvim', { 'branch': 'main' } " temp plugin Plug 'tpope/vim-surround' @@ -100,7 +102,7 @@ set laststatus=2 " show cursor position set ruler set cursorline -" set cursorcolumn +set cursorcolumn set hlsearch " no wrap line set nowrap @@ -265,14 +267,14 @@ let g:rust_recommended_style = 0 let g:rustfmt_autosave = 1 let g:syntastic_rust_checkers = ['cargo'] -let g:airline#extensions#tabline#enabled = 1 -let g:airline#extensions#tabline#show_buffers = 0 -let g:airline#extensions#tabline#show_splits = 0 -let g:airline#extensions#tabline#show_tabs = 1 -let g:airline#extensions#tabline#show_tab_nr = 0 -let g:airline#extensions#tabline#show_tab_type = 0 -let g:airline#extensions#tabline#close_symbol = '×' -let g:airline#extensions#tabline#show_close_button = 0 +" let g:airline#extensions#tabline#enabled = 1 +" let g:airline#extensions#tabline#show_buffers = 0 +" let g:airline#extensions#tabline#show_splits = 0 +" let g:airline#extensions#tabline#show_tabs = 1 +" let g:airline#extensions#tabline#show_tab_nr = 0 +" let g:airline#extensions#tabline#show_tab_type = 0 +" let g:airline#extensions#tabline#close_symbol = '×' +" let g:airline#extensions#tabline#show_close_button = 0 let g:multi_cursor_use_default_mapping=0 @@ -322,9 +324,110 @@ let g:fzf_history_dir = '~/.local/share/fzf-history' lua << EOF -vim.g.neon_style = "dark" -vim.g.neon_transparent = true -vim.cmd[[colorscheme neon]] +require("tokyonight").setup({ + -- your configuration comes here + -- or leave it empty to use the default settings + style = "moon", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day` + light_style = "day", -- The theme is used when the background is set to light + transparent = true, -- Enable this to disable setting the background color + terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim + styles = { + -- Style to be applied to different syntax groups + -- Value is any valid attr-list value for `:help nvim_set_hl` + comments = { italic = true }, + keywords = { italic = true }, + functions = {}, + variables = {}, + -- Background styles. Can be "dark", "transparent" or "normal" + sidebars = "dark", -- style for sidebars, see below + floats = "dark", -- style for floating windows + }, + sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]` + day_brightness = 0.3, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors + hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**. + dim_inactive = false, -- dims inactive windows + lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold + + --- You can override specific color groups to use other groups or a hex color + --- function will be called with a ColorScheme table + ---@param colors ColorScheme + on_colors = function(colors) end, + + --- You can override specific highlights to use other groups or a hex color + --- function will be called with a Highlights and ColorScheme table + ---@param highlights Highlights + ---@param colors ColorScheme + on_highlights = function(highlights, colors) + highlights.CursorLineNr = { + fg = colors.blue5, + bold = true, + } + highlights.LineNr = { + fg = colors.blue, + } + end, +}) +vim.cmd[[colorscheme tokyonight]] + +require('lualine').setup { + options = { + icons_enabled = true, + theme = 'auto', + component_separators = { left = '', right = ''}, + section_separators = { left = '', right = ''}, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + } + }, + sections = { + lualine_a = {'mode'}, + lualine_b = {'branch', 'diff', 'diagnostics'}, + lualine_c = { + { + 'filename', + file_status = true, + newfile_status = true, + path = 1, + }, + }, + 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 = { + { + "tabs", + mode = 2, + } + }, + lualine_b = {}, + lualine_c = {}, + lualine_x = {}, + lualine_y = {}, + lualine_z = {} + }, + winbar = {}, + inactive_winbar = {}, + extensions = {} +} require('tabnine').setup({ disable_auto_comment=true, diff --git a/home/dot_tmux.conf b/home/dot_tmux.conf index 6cf2e67..9973fbd 100644 --- a/home/dot_tmux.conf +++ b/home/dot_tmux.conf @@ -153,3 +153,10 @@ set-option -g status-left "#[fg=green]#(echo $USER)#[default].#[fg=blue]#h#[defa if-shell "hash reattach-to-user-namespace 2> /dev/null" 'set-option -g default-command "reattach-to-user-namespace bash"' +#----------------------------- +# Plugins +#----------------------------- +set -g @plugin 'tmux-plugins/tpm' + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run '~/.tmux/plugins/tpm/tpm'