From 8a05339c7180f76d5d26130083633a203c2e10ce Mon Sep 17 00:00:00 2001 From: Von Random Date: Sat, 3 Sep 2022 19:30:19 +0300 Subject: [PATCH] lotsa changes I will probably roll back, wezterm and nvim added --- alacritty.yml | 4 +- doom/config.org | 42 +------------------- doom/init.el | 6 +-- kitty.conf | 12 +++--- nvim/init.lua | 3 ++ nvim/lua/maps.lua | 32 +++++++++++++++ nvim/lua/plugins.lua | 36 +++++++++++++++++ nvim/lua/settings.lua | 31 +++++++++++++++ nvim/paq-init.zsh | 5 +++ vimplugrc | 2 +- wezterm.lua | 62 ++++++++++++++++++++++++++++++ zsh/{aliases.zsh => functions.zsh} | 11 ++++-- zsh/init.zsh | 2 +- zsh/prompt-powerline.zsh | 40 +++++++++++++------ 14 files changed, 220 insertions(+), 68 deletions(-) create mode 100644 nvim/init.lua create mode 100644 nvim/lua/maps.lua create mode 100644 nvim/lua/plugins.lua create mode 100644 nvim/lua/settings.lua create mode 100644 nvim/paq-init.zsh create mode 100644 wezterm.lua rename zsh/{aliases.zsh => functions.zsh} (91%) diff --git a/alacritty.yml b/alacritty.yml index 71f690a..1e0e3a3 100644 --- a/alacritty.yml +++ b/alacritty.yml @@ -4,8 +4,8 @@ scrolling: font: builtin_box_drawing: true normal: - family: Cascadia Code PL - size: 14 + family: Fantasque Sans Mono + size: 15 colors: primary: diff --git a/doom/config.org b/doom/config.org index 96672ec..6226548 100644 --- a/doom/config.org +++ b/doom/config.org @@ -11,7 +11,7 @@ * Aesthetics Font and theme #+begin_src emacs-lisp -(setq doom-font (font-spec :family "Fantasque Sans Mono" :size 17) +(setq doom-font (font-spec :family "JetBrains Mono" :size 15) doom-variable-pitch-font (font-spec :family "PT Sans")) (setq doom-theme 'doom-gruvbox) #+end_src @@ -27,43 +27,3 @@ Window size and position (setq org-directory "~/org/") (menu-bar-mode -1) #+end_src - -* Package settings -Whenever you reconfigure a package, make sure to wrap your config in an `after!' block, otherwise Doom's defaults may override your settings. E.g. - -(after! PACKAGE - (setq x y)) - -The exceptions to this rule: - -- Setting file/directory variables (like `org-directory') -- Setting variables which explicitly tell you to set them before their package is loaded (see 'C-h v VARIABLE' to look up their documentation). -- Setting doom variables (which start with 'doom-' or '+'). - -Here are some additional functions/macros that will help you configure Doom. - -- `load!' for loading external *.el files relative to this one -- `use-package!' for configuring packages -- `after!' for running code after a package has loaded -- `add-load-path!' for adding directories to the `load-path', relative to this file. Emacs searches the `load-path' when you load packages with `require' or `use-package'. -- `map!' for binding new keys - -To get information about any of these functions/macros, move the cursor over the highlighted symbol at press 'K' (non-evil users must press 'C-c c k'). This will open documentation for it, including demos of how they are used. Alternatively, use `C-h o' to look up a symbol (functions, variables, faces, etc). - -You can also try 'gd' (or 'C-c c d') to jump to their definition and see how they are implemented. -** Org Mode -#+begin_src emacs-lisp -(after! org - (setq org-hide-emphasis-markers t) - (custom-set-faces! - '(org-table :height 1.1 :weight normal) - '(org-level-1 :height 1.8 :weight ultra-bold) - '(org-level-2 :height 1.7 :weight extra-bold) - '(org-level-3 :height 1.6 :weight bold) - '(org-level-4 :height 1.5 :weight semi-bold) - '(org-level-5 :height 1.4 :weight normal) - '(org-level-6 :height 1.3 :weight normal) - '(org-level-7 :height 1.2 :weight normal) - '(org-level-8 :height 1.1 :weight normal)) - (add-hook 'org-mode-hook #'mixed-pitch-mode)) -#+end_src diff --git a/doom/init.el b/doom/init.el index 0d10e30..7ccc26d 100644 --- a/doom/init.el +++ b/doom/init.el @@ -30,7 +30,7 @@ :ui ;;deft ; notational velocity for Emacs doom ; what makes DOOM look the way it does - doom-dashboard ; a nifty splash screen for Emacs + ;;doom-dashboard ; a nifty splash screen for Emacs ;;doom-quit ; DOOM quit-message prompts when you quit Emacs ;;(emoji +unicode) ; 🙂 hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW @@ -95,7 +95,7 @@ (eval +overlay) ; run code, run (also, repls) ;;gist ; interacting with github gists lookup ; navigate your code and its documentation - ;;lsp ; M-x vscode + lsp ; M-x vscode magit ; a git porcelain for Emacs ;;make ; run make tasks from Emacs ;;pass ; password manager for nerds @@ -148,7 +148,7 @@ ;;latex ; writing papers in Emacs has never been so fun ;;lean ; for folks with too much to prove ;;ledger ; be audit you can be - ;;lua ; one-based indices? one-based indices + lua ; one-based indices? one-based indices markdown ; writing docs for people to ignore ;;nim ; python + lisp at the speed of c ;;nix ; I hereby declare "nix geht mehr!" diff --git a/kitty.conf b/kitty.conf index ec10b8f..948de35 100644 --- a/kitty.conf +++ b/kitty.conf @@ -1,19 +1,21 @@ # I am config -font_family Cascadia Code PL -font_size 16 +font_family JetBrains Mono +font_size 15 adjust_line_height 0 adjust_column_width -1 box_drawing_scale 0.1, 0.5, 1, 1.5 disable_ligatures cursor cursor_blink_interval 0 -term kitty-direct +resize_in_steps yes +term xterm-256color +tab_bar_style powerline enable_audio_bell no strip_trailing_spaces always open_url_withopen_url_with default -window_padding_width 1 -placement_strategy top-left +window_padding_width 0 +placement_strategy center remember_window_size no initial_window_width 120c initial_window_height 30c diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..cd7b173 --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,3 @@ +require('settings') +require('maps') +require('plugins') diff --git a/nvim/lua/maps.lua b/nvim/lua/maps.lua new file mode 100644 index 0000000..fd19b29 --- /dev/null +++ b/nvim/lua/maps.lua @@ -0,0 +1,32 @@ +vim.g.mapleader = ' ' + +function unmap(key) + vim.api.nvim_set_keymap('', key, '', {}) +end +function map(mode, key, action) + vim.api.nvim_set_keymap(mode, key, action, {noremap = true}) +end + +-- some unmaps +unmap(' ') +unmap('q') +map('', '', '') +map('!', '', '') + +-- option control +map('n', 'c', ':setlocal cursorline!') +map('n', 'l', ':setlocal list!') +map('n', 'w', ':setlocal wrap!') + +-- search +map('n', '/', ':noh') + +-- copy / paste +map('n', 'y', '"+y') +map('n', 'd', '"+d') +map('n', 'p', '"+p') +map('n', 'P', '"+P') + +-- keymap switch +map('!', '', '') +map('!', '', '') diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua new file mode 100644 index 0000000..549bd32 --- /dev/null +++ b/nvim/lua/plugins.lua @@ -0,0 +1,36 @@ +require('paq') { + 'savq/paq-nvim', + + 'mhinz/vim-signify', + 'tpope/vim-commentary', + 'tpope/vim-fugitive', + 'tpope/vim-rsi', + 'tpope/vim-vinegar', + 'hoob3rt/lualine.nvim', + 'w0rp/ale', + + 'lifepillar/vim-gruvbox8', + 'lifepillar/vim-solarized8', + 'NLKNguyen/papercolor-theme' +} + +require('lualine').setup{ + options = { + icons_enabled = false, + section_separators = { left = '', right = ''}, + component_separators = { left = '', right = ''} + } +} + +vim.g.vimwiki_list = {{path='$HOME/vimwiki/', syntax='markdown', ext='.md'}} +vim.g.PaperColor_Theme_Options = { + theme = { + ["default.dark"] = { allow_bold = 1, allow_italic = 1 }, + ["default.light"] = { allow_bold = 1, allow_italic = 1 } + } +} + +vim.o.bg = 'dark' +vim.o.termguicolors = true +vim.g.gruvbox_filetype_hi_groups = 1 +vim.cmd('colorscheme gruvbox8') diff --git a/nvim/lua/settings.lua b/nvim/lua/settings.lua new file mode 100644 index 0000000..9f33d37 --- /dev/null +++ b/nvim/lua/settings.lua @@ -0,0 +1,31 @@ +vim.o.modeline = false +vim.o.foldmethod = 'marker' +vim.o.cursorline = true +vim.o.colorcolumn = '80' +vim.o.relativenumber = true +vim.o.breakindent = true +vim.o.guicursor = false + +vim.o.list = true +vim.o.listchars = 'tab:|_,nbsp:x,trail:*' + +vim.o.ignorecase = true +vim.o.smartcase = true + +vim.o.scrolloff = 3 +vim.o.sidescrolloff = 15 + +vim.o.tabstop = 3 +vim.o.softtabstop = 4 +vim.o.shiftwidth = 4 +vim.o.expandtab = true + +vim.o.keymap = 'russian-jcukenwintype' +vim.o.iminsert = 0 +vim.o.imsearch = 0 + +vim.o.title = true +vim.o.titlestring = '[%{hostname()}] %t - vim' +vim.o.statusline = '[%F] %R%H%W%M %=[%{&fenc}/%{&ff}] %y [%4l/%L:%3v]' + +vim.o.guifont = 'JetBrains Mono:h15' diff --git a/nvim/paq-init.zsh b/nvim/paq-init.zsh new file mode 100644 index 0000000..c19a4ae --- /dev/null +++ b/nvim/paq-init.zsh @@ -0,0 +1,5 @@ +#!/usr/bin/env zsh +SRC=https://github.com/savq/paq-nvim.git +DST=$HOME/.local/share/nvim/site/pack/paqs/start/paq-nvim + +git clone --depth=1 $SRC $DST diff --git a/vimplugrc b/vimplugrc index 3d3dd51..1f6c282 100644 --- a/vimplugrc +++ b/vimplugrc @@ -20,7 +20,6 @@ endif if theme == 'gruvbox8' call EnableTGC() - let g:gruvbox_transp_bg = 1 let g:gruvbox_plugin_hi_groups = 1 let g:gruvbox_filetype_hi_groups = 1 endif @@ -44,6 +43,7 @@ Plug 'junegunn/vim-plug' " general plugins "Plug 'sheerun/vim-polyglot' +Plug 'hashivim/vim-terraform' Plug 'itchyny/lightline.vim' Plug 'junegunn/fzf' Plug 'junegunn/fzf.vim' diff --git a/wezterm.lua b/wezterm.lua new file mode 100644 index 0000000..78c1b78 --- /dev/null +++ b/wezterm.lua @@ -0,0 +1,62 @@ +local wt = require 'wezterm' +local current_theme = 1 +local theme = + 'Parker Brothers (terminal.sexy)' +local themes = { + 'BirdsOfParadise', + 'Blazer', + 'BlueBerryPie', + 'Dark+', -- another great one | dark / black + 'Doom Peacock', -- nice | dark / black / vivid + 'DWM rob (terminal.sexy)', + 'duskfox', + 'Elio (Gogh)', -- teh best so far | dark / blue + 'Espresso', -- nice, but more on the average side | dark / black + 'Espresso Libre', + 'Fahrenheit', -- all the colors are wrong, but looks cool | dark / red + 'FlatRemix (Gogh)', -- pretty cool | dark / vivid + 'Galaxy', -- pretty nice | dark / blue + 'Galizur', -- great and vivid | dark + 'GJM (terminal.sexy)', -- nice vivid | dark + 'Glacier', -- vivid, very dark + 'gotham (Gogh)', -- surprisingly good, compared to the vim theme + 'Gruvbox Dark', + 'HemisuDark (Gogh)', -- vivid, but dark + 'hund (terminal.sexy)', -- pretty well-balanced dark + 'Japanesque', -- balanced, average, dark + 'Material (terminal.sexy)', -- unusual combination, balanced + 'Medallion', -- quite fun reddish theme, dark + 'MonaLisa', -- impressively good, but very red and dark + 'Neopolitan', -- lovely blue, shitty contrast + 'Parker Brothers (terminal.sexy)', -- unique but kinda dark +} +wt.on('next-theme', function(window) + if current_theme < #themes then + current_theme = current_theme + 1 + else + current_theme = 1 + end + color_scheme = themes[current_theme] + wt.log_info(color_scheme) + window:set_config_overrides {color_scheme=color_scheme} +end) +wt.on('reset-theme', function(window) + wt.log_info(theme) + window:set_config_overrides {} +end) +return { + font_size = 14, + bold_brightens_ansi_colors = false, + use_resize_increments = true, + color_scheme = theme, + keys = { + { key = 'c', mods = 'META', action = wt.action.Copy }, + { key = 'v', mods = 'META', action = wt.action.Paste }, + { key = 'z', mods = 'CTRL', action = wt.action.EmitEvent 'next-theme'}, + { key = 'x', mods = 'CTRL', action = wt.action.EmitEvent 'reset-theme' }, + }, + window_padding = { + left = 0, right = 0, top = 0, bottom = 0, + }, + cursor_blink_rate = 0, +} diff --git a/zsh/aliases.zsh b/zsh/functions.zsh similarity index 91% rename from zsh/aliases.zsh rename to zsh/functions.zsh index 35ef62b..76b1b68 100644 --- a/zsh/aliases.zsh +++ b/zsh/functions.zsh @@ -13,6 +13,13 @@ termcompat() { TERM=$term command $@ } +fsf() { + typeset host prompt="SSH Remote > " + host=$(cut -d\ -f1 $HOME/.ssh/known_hosts | sort -u | fzf --prompt=$prompt) || return 1 + + termcompat ssh $host $@ +} + beep() { printf $'\007' } fixterm() { printf $'c' } @@ -26,9 +33,6 @@ tmux() { command tmux -2 $@ } atmux() { tmux attach || tmux } sush() { command sudo -Es } -ema() { command emacsclient -c $@ } -em() { command emacsclient -t $@ } - tig() { termcompat tig $@ } gsi() { tig status } gci() { command git commit $@ } @@ -45,6 +49,7 @@ greset() { /usr/bin/git clean -fd /usr/bin/git reset --hard } + if [[ -x $(whence -p diff-so-fancy) ]]; then gdf() { gdiff $@ | command diff-so-fancy | command less --tabs=4 -RSFX } else diff --git a/zsh/init.zsh b/zsh/init.zsh index 0e34441..fc42f3f 100644 --- a/zsh/init.zsh +++ b/zsh/init.zsh @@ -8,8 +8,8 @@ confdir=$(dirname $0) conflist=( settings.zsh - aliases.zsh prompt-powerline.zsh + functions.zsh ) for config in $conflist; do diff --git a/zsh/prompt-powerline.zsh b/zsh/prompt-powerline.zsh index 350a83d..21a092e 100644 --- a/zsh/prompt-powerline.zsh +++ b/zsh/prompt-powerline.zsh @@ -17,19 +17,35 @@ typeset -A prompt_symbols=( git_unmerged '*' bang $'\n\U01f525' ) +# gruvbox +#typeset -A prompt_colors=( +# fg '#ebdbb2' +# user '#458588' +# root '#cc241d' +# ssh '#d65d0e' +# host '#504945' +# cwd '#3c3836' +# ro '#d65d0e' +# git_branch '#504945' +# git_unstaged '#d65d0e' +# git_staged '#458588' +# git_untracked '#cc241d' +# git_unmerged '#689d6a' +#) +# 256 color typeset -A prompt_colors=( - fg '#ebdbb2' - user '#458588' - root '#cc241d' - ssh '#d65d0e' - host '#504945' - cwd '#3c3836' - ro '#d65d0e' - git_branch '#504945' - git_unstaged '#d65d0e' - git_staged '#458588' - git_untracked '#cc241d' - git_unmerged '#689d6a' + fg 253 + user 24 + root 124 + ssh 66 + host 238 + cwd 236 + ro 88 + git_branch 238 + git_unstaged 166 + git_untracked 124 + git_unmerged 171 + git_staged 54 ) precmd.prompt.init() {