From 24cc110c45071220d67d17cf2ef72c72155f08d7 Mon Sep 17 00:00:00 2001 From: czjstmax Date: Thu, 16 Apr 2026 23:03:36 +0200 Subject: update `.vimrc` --- cfg/.vimrc | 213 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 206 insertions(+), 7 deletions(-) diff --git a/cfg/.vimrc b/cfg/.vimrc index 1be1f06..b6093fc 100644 --- a/cfg/.vimrc +++ b/cfg/.vimrc @@ -1,5 +1,17 @@ -" vimrc fine shyt +" _ +" ___ ______ _(_)_ __ ___ _ __ ___ +" / __|_ /\ \ / / | '_ ` _ \| '__/ __| +" | (__ / / _\ V /| | | | | | | | | (__ +" \___/___(_)\_/ |_|_| |_| |_|_| \___| +" +" czvimrc -- ideally do *not* use this on vim +" i added a lot of stuff that vim hates here +" since i switched to neovim like last year. +" ------------------------------------------- +" von czjstmax +" ------------------------------------------- +" -------- 'a --------- let g:editorconfig = 0 filetype plugin on " tabs are either 4 or nada @@ -16,6 +28,7 @@ set backspace=indent,eol,start nnoremap :w inoremap :wa tnoremap +" -------- 'b --------- " i set this while crying because vim on windows sucks so much " kinda useless though nvim suxx so this is still useful " relative line numbers for life @@ -30,10 +43,14 @@ set mouse= set guifont=Comic\ Mono:h12 :command! Nobg hi Normal guibg=NONE ctermbg=NONE let mapleader = "," -vnoremap / :s/^/\/\/ /:nohl + +" -------- 'c --------- +command! Src source ~/.vimrc +command! Vimrc edit ~/.vimrc " the coolest regex-es you'll see (fake as fuck) command! RmComments %s/\s*\/\/\s*.*// +" -------- 'C --------- "add time at the right of status bar thing set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P\ %{strftime(\"%Y年%m月%d日\ %H時%M分%S秒\")} @@ -41,7 +58,8 @@ set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P\ %{strftime(\"%Y年%m月%d日\ " for vim-polyglot set nocompatible -" vim-plug fine shyt +" -------- 'p --------- +" vim-plug section call plug#begin() " plugin list @@ -58,10 +76,39 @@ call plug#begin() Plug 'zenlang/zen.vim' Plug 'sheerun/vim-polyglot' Plug 'phanviet/vim-monokai-pro' + Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} + Plug 'nvim-neo-tree/neo-tree.nvim' + Plug 'nvim-telescope/telescope.nvim' + Plug 'nvim-lua/plenary.nvim' + Plug 'nvim-tree/nvim-web-devicons' + Plug 'MunifTanjim/nui.nvim' + Plug 'lewis6991/gitsigns.nvim' + Plug 'kdheepak/lazygit.nvim' + Plug 'kylechui/nvim-surround' + Plug 'numToStr/Comment.nvim' + Plug 'nvim-lualine/lualine.nvim' call plug#end() +" -------- 'P --------- + +nnoremap gg :LazyGit +nnoremap e :Neotree toggle + +nnoremap hp :Gitsigns preview_hunk +nnoremap hs :Gitsigns stage_hunk +nnoremap hr :Gitsigns reset_hunk + +nnoremap ff Telescope find_files +nnoremap fg Telescope live_grep +nnoremap fb Telescope buffers -" skkeleton +lua << EOF + require("nvim-surround").setup({}) + require('Comment').setup() +EOF + +" -------- 'k --------- +" skkeleton " 1) global toggle stays simple and stable imap (skkeleton-toggle) cmap (skkeleton-toggle) @@ -90,13 +137,16 @@ augroup skkeleton-initialize-pre autocmd User skkeleton-initialize-pre call s:skkeleton_init() augroup END -" theme +" -------- 't --------- +" theme set background=dark "silent! color chocolatier "silent! color retrobox -"silent! color ashen -silent! color monokai_pro +silent! color ashen +"silent! color monokai_pro +" -------- 'T --------- +" -------- 'd --------- " disable BIG jumps everywhere (shift+up / shift+down act like plain arrows) map map @@ -113,15 +163,23 @@ omap cmap cmap +" -------- 'e --------- augroup nasm_inc autocmd! autocmd BufRead,BufNewFile *.inc set filetype=nasm augroup END +" genius idea i came up with +augroup fuck_ftdetect + autocmd! + autocmd TextChanged,InsertLeave * if &ft == '' | filetype detect | endif +augroup END + lua << EOF require('nvim-autopairs').setup{} EOF +" -------- 'f --------- " === coc.nvim config === let g:coc_global_extensions = ['coc-clangd', 'coc-html', 'coc-tsserver', 'coc-sh', 'coc-css', 'coc-pyright', 'coc-go'] let g:coc_user_config = {'clangd.inlayHints.enable': v:false} @@ -145,6 +203,147 @@ autocmd CursorHoldI * silent call CocActionAsync('showSignatureHelp') autocmd FileType javascript,typescript setlocal shiftwidth=4 tabstop=4 softtabstop=4 autocmd FileType javascript,typescript setlocal indentexpr= +" -------- 'g --------- " zen-c filetype detection (w zuhaitz) au BufRead,BufNewFile *.zc set filetype=zen +" reborn filetype detection +" temporarily set to filetype=c +au BufRead,BufNewFile *.rn set filetype=c +au BufRead,BufNewFile *.rh set filetype=c + +" -------- 'h --------- +lua << EOF + local lualine_bg = "#212121" + + local function jp_time() + return os.date("%Y年%m月%d日 %H時%M分%S秒") + end + + local function mode() + local m = vim.fn.mode() + + local map = { + n = "n / ノーマル", + i = "i / インサート", + v = "v / ビジュアル", + V = "v / ビジュアル", + ["\22"] = "v / ビジュアル", + c = "c / コマンド", + R = "r / リプレイス", + t = "t / ターミナル", + } + + return map[m] or m + end + + local palette = { + "#f82323", + "#e13b3b", + "#c85656", + "#a96a6a", + "#8b7a7a", + "#6f7a6a", + "#5f6a6a", + "#808080", + "#5f6a6a", + "#6f6a6a", + "#8b7a7a", + "#a96a6a", + "#c85656", + "#e13b3b", + } + + local function get_color() + local i = math.floor(vim.loop.hrtime() / 1e8) % #palette + 1 + return palette[i] + end + + local function bg() + return lualine_bg + end + + local function lualine_theme() + local bg = lualine_bg + + return { + normal = { a = { bg = bg, fg = "#ffffff" }, b = { bg = bg, fg = "#ffffff" }, c = { bg = bg } }, + insert = { a = { bg = bg, fg = "#ffffff" }, b = { bg = bg, fg = "#ffffff" }, c = { bg = bg } }, + visual = { a = { bg = bg, fg = "#ffffff" }, b = { bg = bg, fg = "#ffffff" }, c = { bg = bg } }, + replace = { a = { bg = bg, fg = "#ffffff" }, b = { bg = bg, fg = "#ffffff" }, c = { bg = bg } }, + command = { a = { bg = bg, fg = "#ffffff" }, b = { bg = bg, fg = "#ffffff" }, c = { bg = bg } }, + inactive = { a = { bg = bg, fg = "#888888" }, b = { bg = bg, fg = "#888888" }, c = { bg = bg } }, + } + end + + require('lualine').setup({ + options = { + theme = lualine_theme(), + icons_enabled = true, + globalstatus = true, + component_separators = { left = '//', right = '//' }, + section_separators = { left = '', right = '' }, + }, + + sections = { + + lualine_a = { + { + mode, + color = function() + return { fg = get_color(), bg = lualine_bg, gui = "bold" } + end + } + }, + + lualine_b = { + { + 'branch', + color = function() return { bg = lualine_bg, fg = "#ffffff" } end + }, + { + 'diff', + color = function() return { bg = lualine_bg } end + } + }, + + lualine_c = { + { + 'filename', + path = 1, + color = function() return { bg = lualine_bg, fg = "#ffffff" } end + } + }, + + lualine_x = { + { + 'diagnostics', + color = function() return { bg = lualine_bg } end + }, + { + 'encoding', + color = function() return { bg = lualine_bg } end + }, + { + 'fileformat', + color = function() return { bg = lualine_bg } end + }, + }, + + lualine_y = { + { + 'filetype', + color = function() return { bg = lualine_bg, fg = "#ffffff" } end + } + }, + + lualine_z = { + { + jp_time, + color = function() return { bg = lualine_bg } end + } + }, + }, + }) +EOF + -- cgit v1.3.1