diff --git a/README.md b/README.md index b8245c2..5193d29 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # my dots dots for my laptop 「itomori」, managed with `gnu stow`. - Files can be `stow`'ed and un'`stow`'ed with `stow.sh`. It will link all dotfiles to their correct place. Un-`stow` with `./stow.sh -D`. @@ -9,9 +8,10 @@ Un-`stow` with `./stow.sh -D`. ## deps + `fzf` (`zsh`, `nvim`) + `ripgrep` (`nvim`) -+ `ripgrep-all` (`zsh`) + `fd` (rust find; `nvim`) +Also run `checkhealth` in `nvim` after a first install + ## 日本語入力 With `ibus-anthy` under GNOME use: + `GTK_IM_MODULE=ibus` diff --git a/files/nvim/.config/nvim/lua/mappings.lua b/files/nvim/.config/nvim/lua/mappings.lua index 4984848..62881c0 100644 --- a/files/nvim/.config/nvim/lua/mappings.lua +++ b/files/nvim/.config/nvim/lua/mappings.lua @@ -5,6 +5,7 @@ local default_opts = { noremap = true, silent = true } vim.g.mapleader = ' ' map("n", "", " noh", default_opts) +map("n", "", " messages", default_opts) -- Telescope local telescope = require 'telescope' @@ -23,11 +24,9 @@ telescope.setup({ } } }) -map("n", "", " Telescope telescope-tabs list_tabs", default_opts) -- Show all tabs map("n", "", " Telescope find_files hidden=true", default_opts) -- Show files map("n", "", " Telescope live_grep", default_opts) -- Grep through current directory map("n", "", " Telescope keymaps", default_opts) -- Show all keys -map("n", "", " Noice", default_opts) -- Show all notifications -- Telescope + LSP map("n", "la", " lua vim.lsp.buf.code_action()", default_opts) -- Apply LSP code action diff --git a/files/nvim/.config/nvim/lua/plugins/init.lua b/files/nvim/.config/nvim/lua/plugins/init.lua index 50fe6c4..972ac23 100644 --- a/files/nvim/.config/nvim/lua/plugins/init.lua +++ b/files/nvim/.config/nvim/lua/plugins/init.lua @@ -2,6 +2,9 @@ -- Define all plugins in this file, -- but maintain config in -conf.lua +-- NOTE: +-- Run `checkhealth` after first install + -- Mention all dependencies in 'requires', but create their own entry, -- if they need configuration. @@ -55,15 +58,6 @@ return require('packer').startup(function(use) config = function() require('plugins.telescope-conf') end, }) - -- browse tabs in telescope - use { - 'LukasPietzschmann/telescope-tabs', - requires = { 'nvim-telescope/telescope.nvim' }, - config = function() - require'telescope-tabs'.setup{} - end -} - -- Auto Indentation use({ 'nmac427/guess-indent.nvim', @@ -148,14 +142,10 @@ return require('packer').startup(function(use) config = function() require('plugins.nvim-colorizer-conf') end }) - -- cooler cmd line and notifications + -- fancy lsp loading animation use({ - "folke/noice.nvim", - requires = { - "MunifTanjim/nui.nvim", -- frontend for cmdline - }, - event = "VimEnter", - config = function() require("plugins.noice-conf") end, + 'j-hui/fidget.nvim', + config = function() require"fidget".setup{} end, }) -- latex synctex diff --git a/files/nvim/.config/nvim/lua/plugins/lualine-conf.lua b/files/nvim/.config/nvim/lua/plugins/lualine-conf.lua index 0b41033..92e63be 100644 --- a/files/nvim/.config/nvim/lua/plugins/lualine-conf.lua +++ b/files/nvim/.config/nvim/lua/plugins/lualine-conf.lua @@ -46,34 +46,34 @@ require('lualine').setup({ -- lualine comes with 'everforest' theme theme = 'everforest', }, - tabline = { - lualine_a = { - -- function() - -- return mode_map[vim.api.nvim_get_mode().mode] or "__" - -- end - function() - return '裡' - end, - }, - lualine_b = { - { - 'tabs', - mode = 2, - max_length = vim.o.columns / 2 - } - }, - lualine_c = { - - }, - lualine_x = { - -- 'lsp_progress' -- noice already shows this.. better - }, - lualine_y = { - require('nvim-navic').get_location - }, - lualine_z = { - } - }, + -- tabline = { + -- lualine_a = { + -- -- function() + -- -- return mode_map[vim.api.nvim_get_mode().mode] or "__" + -- -- end + -- function() + -- return '裡' + -- end, + -- }, + -- lualine_b = { + -- { + -- 'tabs', + -- mode = 2, + -- max_length = vim.o.columns / 2 + -- } + -- }, + -- lualine_c = { + -- + -- }, + -- lualine_x = { + -- -- 'lsp_progress' -- noice already shows this.. better + -- }, + -- lualine_y = { + -- require('nvim-navic').get_location + -- }, + -- lualine_z = { + -- } + -- }, -- all sections from left to right sections = { lualine_a = { @@ -101,13 +101,15 @@ require('lualine').setup({ }, }, lualine_y = { - 'filetype', 'encoding', 'fileformat', + 'filetype', + }, + lualine_z = { -- show wordcount in md and tex file -- show precise count when selecting function() - if vim.bo.filetype == "md" or vim.bo.filetype == "tex" then + if vim.bo.filetype == "markdown" or vim.bo.filetype == "tex" then if vim.fn.wordcount().visual_words == 1 then return tostring(vim.fn.wordcount().visual_words) .. " word" elseif not (vim.fn.wordcount().visual_words == nil) then @@ -118,16 +120,13 @@ require('lualine').setup({ else return "" end - end - }, - lualine_z = { - 'progress', + end, 'location', -- Show trailing whitespace function() local space = vim.fn.search([[\s\+$]], 'nwc') return space ~= 0 and "TW:" .. space or "" - end + end, }, }, }) diff --git a/files/nvim/.config/nvim/lua/plugins/noice-conf.lua b/files/nvim/.config/nvim/lua/plugins/noice-conf.lua index 4027431..6ce934a 100644 --- a/files/nvim/.config/nvim/lua/plugins/noice-conf.lua +++ b/files/nvim/.config/nvim/lua/plugins/noice-conf.lua @@ -1 +1,19 @@ -require("noice").setup({}) +require("noice").setup({ + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + progress = { + view = "mini", + } + }, + messages = { + enabled = true, -- enables the Noice messages UI + view = "mini", -- default view for messages + view_error = "mini", -- view for errors + view_warn = "mini", -- view for warnings + }, +}) diff --git a/files/nvim/.config/nvim/lua/plugins/nvim-treesitter-conf.lua b/files/nvim/.config/nvim/lua/plugins/nvim-treesitter-conf.lua index d55adc0..3f6474d 100644 --- a/files/nvim/.config/nvim/lua/plugins/nvim-treesitter-conf.lua +++ b/files/nvim/.config/nvim/lua/plugins/nvim-treesitter-conf.lua @@ -10,6 +10,9 @@ require('nvim-treesitter.configs').setup({ "python", "rust", "yaml", + "vim", + "markdown", + "markdown_inline" }, auto_intall = true, highlight = { diff --git a/files/nvim/.config/nvim/lua/plugins/telescope-conf.lua b/files/nvim/.config/nvim/lua/plugins/telescope-conf.lua index d62f027..3ba0769 100644 --- a/files/nvim/.config/nvim/lua/plugins/telescope-conf.lua +++ b/files/nvim/.config/nvim/lua/plugins/telescope-conf.lua @@ -7,7 +7,7 @@ require('telescope').setup({ layout_strategy = "vertical", layout_config = { vertical = { - width = 120, + width = 160, prompt_position = "top", mirror = true, } diff --git a/files/tmux/.tmux.conf b/files/tmux/.tmux.conf index cde1cfd..42a1eaf 100644 --- a/files/tmux/.tmux.conf +++ b/files/tmux/.tmux.conf @@ -92,5 +92,5 @@ setw -g window-status-style "none,fg=#939f91,bg=#FDF6E3" set -g status-left "" # show battery only on laptop if-shell "[ `hostname` = 'itomori' ]" 'set -g status-right "#[fg=#939f91,bg=#FDF6E3] #H @ #S | #(cat /sys/class/power_supply/BAT1/capacity)% | %H:%M"' 'set -g status-right "#[fg=#939f91,bg=#FFF9E8] #H @ #S | %H:%M"' -setw -g window-status-format "#[bg=#FDF6E3][#I  #W]" -setw -g window-status-current-format "#[fg=#93b259,bold][#I  #W]" +setw -g window-status-format "#I:#W" +setw -g window-status-current-format "#[fg=#93b259,bold]#I:#W*" diff --git a/files/vim/.vimrc b/files/vim/.vimrc index ac323c1..3ac056e 100644 --- a/files/vim/.vimrc +++ b/files/vim/.vimrc @@ -28,7 +28,6 @@ syntax on set background=light let g:everforest_background = 'medium' let g:everforest_better_performance = 1 -" let g:everforest_enable_italic = 1 colorscheme everforest let &t_8f = "\[38;2;%lu;%lu;%lum" let &t_8b = "\[48;2;%lu;%lu;%lum" @@ -59,21 +58,7 @@ set scrolloff=5 " minimum lines above or below the cursor let g:ctrlp_show_hidden = 1 " show hidden files in ctrlp menus " ============================== Statusline -set laststatus=1 " 1: only if there are at least two windows -set showtabline=1 " 1: only if there are at least two tab pages let g:airline_powerline_fonts = 1 - -" tabline -let g:airline#extensions#tabline#enabled = 1 -let g:airline#extensions#tabline#formatter = 'default' -let g:airline#extensions#tabline#show_tabs = 1 -let g:airline#extensions#tabline#show_tab_nr = 1 -let g:airline#extensions#tabline#tab_nr_type = 1 -let g:airline#extensions#tabline#show_buffers = 0 -let g:airline#extensions#tabline#tabs_label = '裡' -let g:airline#extensions#tabline#show_close_button = 0 -let g:airline#extensions#tabline#show_tab_count = 0 - let g:airline_mode_map = { \ 'i' : '', \ 'ic' : '', @@ -85,11 +70,15 @@ let g:airline_mode_map = { \ 'R' : 'ﰇ', \ 'Rv' : 'ﰇ', \ 'v' : '', - \ 'V' : ' ', - \ '␖' : ' 麗', + \ 'V' : '  ', + \ '' : ' ', \ 'c' : '' \ } +let g:airline_section_x = airline#section#create([]) +let g:airline_section_y = airline#section#create_right(['%{&fileencoding}', '%{&fileformat}', '%{&filetype}']) +let g:airline_section_z = airline#section#create(['%{line(".")}:%{col(".")}']) + " ============================== Indents and Whitespaces set list set listchars=tab:──\ ,extends:›,precedes:‹,nbsp:·,trail:· " show chars for whitespaces @@ -117,7 +106,6 @@ let g:netrw_liststyle = 3 " Tree-like structure let g:netrw_banner = 0 " Remove useless banner at the top of netrw " ============================== Macros and Mappings -" open fuzzy file browser map :CtrlP . " C-/ to hide search results map :noh