From 074e0891acf07089525bc575557fcdc5725bfdd0 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Wed, 2 Nov 2022 12:17:19 -0400 Subject: [PATCH] Cleanup after missed commits before format xD --- bin/bin/toggle-color-mode | 4 +- install.sh | 4 +- nvim/.config/nvim/after/plugin/config.lua | 62 +++++ nvim/.config/nvim/init.lua | 277 +--------------------- nvim/.config/nvim/lua/config.lua | 86 +++++++ nvim/.config/nvim/lua/options.lua | 38 +++ nvim/.config/nvim/lua/plugins.lua | 40 ++++ tmux/.config/tmux/tmux.conf | 2 +- vim/.config/vim/undo/.gitinclude | 0 vim/.vimrc | 203 ---------------- 10 files changed, 235 insertions(+), 481 deletions(-) create mode 100644 nvim/.config/nvim/after/plugin/config.lua create mode 100644 nvim/.config/nvim/lua/config.lua create mode 100644 nvim/.config/nvim/lua/options.lua create mode 100644 nvim/.config/nvim/lua/plugins.lua delete mode 100644 vim/.config/vim/undo/.gitinclude delete mode 100644 vim/.vimrc diff --git a/bin/bin/toggle-color-mode b/bin/bin/toggle-color-mode index 43d000b..827ded1 100755 --- a/bin/bin/toggle-color-mode +++ b/bin/bin/toggle-color-mode @@ -1,8 +1,8 @@ #!/bin/bash -color_file=$HOME/.config/atomaka/color.yml +color_file=$HOME/.config/$USERNAME/color.yml if ! test -f $color_file; then - mkdir -p $HOME/.config/atomaka + mkdir -p $HOME/.config/$USERNAME echo light > $color_file fi old_color=$(cat $color_file) diff --git a/install.sh b/install.sh index 127f03c..2aab8cb 100755 --- a/install.sh +++ b/install.sh @@ -42,6 +42,7 @@ install_alacritty() { sudo mv /tmp/Alacritty.svg /usr/share/pixmaps/Alacritty.svg sudo desktop-file-install /tmp/Alacritty.desktop sudo update-desktop-database + sudo ln -s /home/$USERNAME/.cargo/bin/alacritty /usr/local/bin/alacritty fi } @@ -124,7 +125,8 @@ main() { ;; esac - stow alacritty bin git nvim ruby tmux vim zsh + stow alacritty bin git nvim ruby tmux zsh + install_alacritty_terminfo } main diff --git a/nvim/.config/nvim/after/plugin/config.lua b/nvim/.config/nvim/after/plugin/config.lua new file mode 100644 index 0000000..883fc61 --- /dev/null +++ b/nvim/.config/nvim/after/plugin/config.lua @@ -0,0 +1,62 @@ +-- PLUGIN CONFIGURATION +--- bufdelete.nvim +vim.keymap.set("n", "bd", function() + require("bufdelete").bufdelete(0, true) +end) + +--- gitlinker.nvim +require"gitlinker".setup() +vim.keymap.set("n", "gh", function() + require"gitlinker".get_buf_range_url( + "n", + { action_callback = require"gitlinker.actions".open_in_browser } + ) +end, { silent = true }) +vim.keymap.set("v", "gh", function() + require"gitlinker".get_buf_range_url( + "v", + { action_callback = require"gitlinker.actions".open_in_browser } + ) +end) + +--- gitsigns.nvim +require("gitsigns").setup() +vim.keymap.set("n", "gb", require("gitsigns").toggle_current_line_blame) + +--- NeoZoom.lua +require("neo-zoom").setup({ + left_ratio = 0, + top_ratio = 0, + width_ratio = 1, + height_ratio = 1, + border = "none", +}) +vim.keymap.set("n", "z", require("neo-zoom").neo_zoom) + +--- nvim-surround +require("nvim-surround").setup() + +--- packer.nvim +vim.keymap.set("n", "pi", function() + vim.cmd("PackerCompile") + vim.cmd("PackerInstall") +end) +vim.keymap.set("n", "pu", ":PackerSync") +vim.keymap.set("n", "pc", ":PackerClean") + +--- telescope.nvim +vim.keymap.set("n", "", function() + require("telescope.builtin").find_files({ + file_ignore_patterns = {".git/", "node_modules/"}, + hidden = true, + previewer = false, + }) +end) + +--- whitespace.nvim +require("whitespace-nvim").setup({ + hightlight = "red" +}) +vim.keymap.set("n", "fw", function() + require("whitespace-nvim").trim() +end, { silent = true }) diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index dd9d1e5..de3c6ea 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -1,274 +1,3 @@ -local ensure_packer = function() - local fn = vim.fn - local install_path = fn.stdpath("data").."/site/pack/packer/start/packer.nvim" - if fn.empty(fn.glob(install_path)) > 0 then - fn.system({"git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path}) - vim.cmd [[packadd packer.nvim]] - return true - end - return false -end - -local packer_bootstrap = ensure_packer() - -require("packer").startup(function(use) - local use = use - - use "wbthomason/packer.nvim" - -- TODO: autoupdate (but after plugins separate file - -- augroup packer_user_config - -- autocmd! - -- autocmd BufWritePost plugins.lua source | PackerCompile - -- augroup end - - use "nvim-lua/plenary.nvim" - use "nvim-telescope/telescope.nvim" - - use "nvim-treesitter/nvim-treesitter" - use "nvim-treesitter/nvim-treesitter-context" - - use "famiu/bufdelete.nvim" - use "gpanders/editorconfig.nvim" - use "johnfrankmorgan/whitespace.nvim" - use "kylechui/nvim-surround" - use "L3MON4D3/LuaSnip" - use "lewis6991/gitsigns.nvim" - use "nyngwang/NeoZoom.lua" -- TODO: Floating window background color - use "ruifm/gitlinker.nvim" - - use "neovim/nvim-lspconfig" - use "hrsh7th/nvim-cmp" - use "hrsh7th/cmp-nvim-lsp" - use "hrsh7th/cmp-buffer" - use "hrsh7th/cmp-path" - use "hrsh7th/cmp-nvim-lua" - use 'saadparwaiz1/cmp_luasnip' - - use "gruvbox-community/gruvbox" -end) - ---- SETTING CONFIGURATION -vim.opt.autowrite = true --- vim.opt.backspace = 2 -- default in neovim? -vim.opt.cpoptions:append("$") --- vim.opt.endofline -- default in neovim? --- vim.opt.laststatus = 2 -- default in neovim? --- vim.opt.backup = false -- default in neovim? -vim.opt.swapfile = false -vim.opt.wrap = false -vim.opt.scrolloff = 3 -vim.opt.showmatch = true --- vim.opt.showmode = true -- default in neovim? --- vim.opt.showmode = true -- default in neovim? -vim.opt.timeoutlen = 500 -vim.opt.virtualedit = "all" --- vim.opt.hlsearch = true -- default in neovim? -vim.opt.ignorecase = true --- vim.opt.incsearch = true -- default in neovim? -vim.opt.smartcase = true --- vim.opt.wrapscan = true -- default in neovim? - -vim.opt.number = true -vim.opt.relativenumber = true - -vim.opt.textwidth = 80 -vim.opt.colorcolumn = {80, 120} - --- Tabs are 2 spaces -vim.opt.tabstop = 2 -vim.opt.softtabstop = 2 -vim.opt.shiftwidth = 2 -vim.opt.expandtab = true -vim.opt.shiftround = true -- make >> go to next tab - --- undo -vim.opt.undolevels = 5000 -vim.opt.undofile = true -vim.opt.undodir = os.getenv("HOME") .. "/.config/nvim/undo" - --- REMAP CONFIGURATION ---- Stay in visual mode while tabbing -vim.keymap.set("v", ">", ">gv") -vim.keymap.set("v", "<", "") -vim.keymap.set("v", "S", 'y:%s/"//g') - ---- COMMAND CONFIGURATION ---- Avoid typos -vim.api.nvim_create_user_command("W", "w", {}) -vim.api.nvim_create_user_command("Wq", "wq", {}) - --- CUSTOM CONFIGURATION ---- Targetting! -local reticle = vim.api.nvim_create_augroup("Reticle", { - clear = true -}) - -vim.api.nvim_create_autocmd({"VimEnter", "WinEnter", "BufWinEnter"}, { - group = reticle, - callback = function() - vim.opt_local.cursorline = true - vim.opt_local.cursorcolumn = true - end -}) -vim.api.nvim_create_autocmd({"WinLeave"}, { - group = reticle, - callback = function() - vim.opt_local.cursorline = false - vim.opt_local.cursorcolumn = false - end -}) - ---- background matching terminal -function ChangeBackground() - local file = io.open(os.getenv("HOME") .. "/.config/atomaka/color.yml", "rb") - local background = file:read() - file:close() - vim.opt.background = background -end -ChangeBackground() - --- LEADER CONFIGURATION -vim.g.mapleader = "," - -vim.keymap.set("n", "sz", ":luafile ~/.config/nvim/init.lua") - -vim.keymap.set({ "n", "v" }, "cp", '"+y') -vim.keymap.set({ "n", "v" }, "pa", '"+P') - -vim.keymap.set("n", "cs", ":let @/ = ''") -vim.keymap.set("n", "fj", ":%!jq .") -vim.keymap.set("n", "gg", ":exe '!gh gist create -w %:p'") - ---- tabs -vim.keymap.set("n", "2", function() - print("Setting tabstop to 2") - vim.opt.tabstop = 2 - vim.opt.shiftwidth = 2 - vim.opt.expandtab = true -end) -vim.keymap.set("n", "4", function() - print("Setting tabstop to 4") - vim.opt.tabstop = 4 - vim.opt.shiftwidth = 4 - vim.opt.expandtab = true -end) -vim.keymap.set("n", "a", function() - print("Setting tabstop to tab") - vim.opt.tabstop = 8 - vim.opt.shiftwidth = 8 - vim.opt.expandtab = false -end) -vim.keymap.set("n", "st", ':let @/ = "\t"') - --- COLOR CONFIGURATION -vim.cmd("colorscheme gruvbox") -vim.api.nvim_create_autocmd({"ColorScheme", "BufWinEnter"}, { - callback = function() - vim.cmd("hi Normal ctermbg=NONE guibg=NONE") - end, -}) - --- PLUGIN CONFIGURATION ---- bufdelete.nvim -vim.keymap.set("n", "bd", function() - require("bufdelete").bufdelete(0, true) -end) - ---- gitlinker.nvim -require"gitlinker".setup() -vim.keymap.set("n", "gh", function() - require"gitlinker".get_buf_range_url( - "n", - { action_callback = require"gitlinker.actions".open_in_browser } - ) -end, { silent = true }) -vim.keymap.set("v", "gh", function() - require"gitlinker".get_buf_range_url( - "v", - { action_callback = require"gitlinker.actions".open_in_browser } - ) -end) - ---- gitsigns.nvim -require("gitsigns").setup() -vim.keymap.set("n", "gb", require("gitsigns").toggle_current_line_blame) - ---- NeoZoom.lua -require("neo-zoom").setup({ - left_ratio = 0, - top_ratio = 0, - width_ratio = 1, - height_ratio = 1, - border = "none", -}) -vim.keymap.set("n", "z", require("neo-zoom").neo_zoom) - ---- nvim-cmp -require("cmp").setup({ -- TODO: More incoming - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - } -}) - ---- nvim-lspconfig -require("lspconfig").rust_analyzer.setup({ - capabilities = require("cmp_nvim_lsp").update_capabilities( - vim.lsp.protocol.make_client_capabilities() - ), -}) - ---- nvim-surround -require("nvim-surround").setup() - ---- nvim-treesitter -require"nvim-treesitter.configs".setup { - ensure_installed = "all", - sync_install = false, - ignore_install = { "phpdoc" }, -- TODO: https://github.com/claytonrcarter/tree-sitter-phpdoc/issues/15 - - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, -} - --- nvim-treesitter-context -require("treesitter-context").setup({ - patterns = { - rust = { - -- default rust - "impl_item", - "struct", - "enum", - - -- substrate xD - "macro_invocation", - }, - }, -}) - ---- packer.nvim -vim.keymap.set("n", "pi", function() - vim.cmd("PackerCompile") - vim.cmd("PackerInstall") -end) -vim.keymap.set("n", "pu", ":PackerSync") -vim.keymap.set("n", "pc", ":PackerClean") - ---- telescope.nvim -vim.keymap.set("n", "", function() - require("telescope.builtin").git_files() -end) - ---- whitespace.nvim -require("whitespace-nvim").setup({ - hightlight = "red" -}) -vim.keymap.set("n", "fw", function() - require("whitespace-nvim").trim() -end, { silent = true }) +require "plugins" +require "options" +require "config" diff --git a/nvim/.config/nvim/lua/config.lua b/nvim/.config/nvim/lua/config.lua new file mode 100644 index 0000000..1ba10ea --- /dev/null +++ b/nvim/.config/nvim/lua/config.lua @@ -0,0 +1,86 @@ +-- REMAP CONFIGURATION +--- Stay in visual mode while tabbing +vim.keymap.set("v", ">", ">gv") +vim.keymap.set("v", "<", "") +vim.keymap.set("v", "S", 'y:%s/"//g') + +--- COMMAND CONFIGURATION +--- Avoid typos +vim.api.nvim_create_user_command("W", "w", {}) +vim.api.nvim_create_user_command("Wq", "wq", {}) + +-- CUSTOM CONFIGURATION +--- Targetting! +local reticle = vim.api.nvim_create_augroup("Reticle", { + clear = true +}) + +vim.api.nvim_create_autocmd({"VimEnter", "WinEnter", "BufWinEnter"}, { + group = reticle, + callback = function() + vim.opt_local.cursorline = true + vim.opt_local.cursorcolumn = true + end +}) +vim.api.nvim_create_autocmd({"WinLeave"}, { + group = reticle, + callback = function() + vim.opt_local.cursorline = false + vim.opt_local.cursorcolumn = false + end +}) + +--- background matching terminal +function ChangeBackground() + local home = os.getenv("HOME") + local user = os.getenv("USERNAME") + local file = io.open(home.."/.config/"..user.."/color.yml", "rb") + local background = file:read() + file:close() + vim.opt.background = background +end +ChangeBackground() + +-- LEADER CONFIGURATION +vim.g.mapleader = "," + +vim.keymap.set("n", "sz", ":luafile ~/.config/nvim/init.lua") + +vim.keymap.set({ "n", "v" }, "cp", '"+y') +vim.keymap.set({ "n", "v" }, "pa", '"+P') + +vim.keymap.set("n", "cs", ":let @/ = ''") +vim.keymap.set("n", "fj", ":%!jq .") +vim.keymap.set("n", "gg", ":exe '!gh gist create -w %:p'") + +--- tabs +vim.keymap.set("n", "2", function() + print("Setting tabstop to 2") + vim.opt.tabstop = 2 + vim.opt.shiftwidth = 2 + vim.opt.expandtab = true +end) +vim.keymap.set("n", "4", function() + print("Setting tabstop to 4") + vim.opt.tabstop = 4 + vim.opt.shiftwidth = 4 + vim.opt.expandtab = true +end) +vim.keymap.set("n", "a", function() + print("Setting tabstop to tab") + vim.opt.tabstop = 8 + vim.opt.shiftwidth = 8 + vim.opt.expandtab = false +end) +vim.keymap.set("n", "st", ':let @/ = "\t"') + +-- COLOR CONFIGURATION +vim.cmd("colorscheme gruvbox") +vim.api.nvim_create_autocmd({"ColorScheme", "BufWinEnter"}, { + callback = function() + vim.cmd("hi Normal ctermbg=NONE guibg=NONE") + end, +}) diff --git a/nvim/.config/nvim/lua/options.lua b/nvim/.config/nvim/lua/options.lua new file mode 100644 index 0000000..0226f75 --- /dev/null +++ b/nvim/.config/nvim/lua/options.lua @@ -0,0 +1,38 @@ +-- SETTING CONFIGURATION +vim.opt.autowrite = true +-- vim.opt.backspace = 2 -- default in neovim? +vim.opt.cpoptions:append("$") +-- vim.opt.endofline -- default in neovim? +-- vim.opt.laststatus = 2 -- default in neovim? +-- vim.opt.backup = false -- default in neovim? +vim.opt.swapfile = false +vim.opt.wrap = false +vim.opt.scrolloff = 3 +vim.opt.showmatch = true +-- vim.opt.showmode = true -- default in neovim? +-- vim.opt.showmode = true -- default in neovim? +vim.opt.timeoutlen = 500 +vim.opt.virtualedit = "all" +-- vim.opt.hlsearch = true -- default in neovim? +vim.opt.ignorecase = true +-- vim.opt.incsearch = true -- default in neovim? +vim.opt.smartcase = true +-- vim.opt.wrapscan = true -- default in neovim? + +vim.opt.number = true +vim.opt.relativenumber = true + +vim.opt.textwidth = 80 +vim.opt.colorcolumn = {80, 120} + +-- Tabs are 2 spaces +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.expandtab = true +vim.opt.shiftround = true -- make >> go to next tab + +-- undo +vim.opt.undolevels = 5000 +vim.opt.undofile = true +vim.opt.undodir = os.getenv("HOME") .. "/.config/nvim/undo" diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua new file mode 100644 index 0000000..c9bd300 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins.lua @@ -0,0 +1,40 @@ +local ensure_packer = function() + local fn = vim.fn + local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' + if fn.empty(fn.glob(install_path)) > 0 then + fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) + vim.cmd [[packadd packer.nvim]] + return true + end + return false +end + +local packer_bootstrap = ensure_packer() + +return require('packer').startup(function(use) + local use = use + + use "wbthomason/packer.nvim" + -- TODO: autoupdate (but after plugins separate file + -- augroup packer_user_config + -- autocmd! + -- autocmd BufWritePost plugins.lua source | PackerCompile + -- augroup end + + use "nvim-lua/plenary.nvim" + use "nvim-telescope/telescope.nvim" + + use "famiu/bufdelete.nvim" + use "gpanders/editorconfig.nvim" + use "johnfrankmorgan/whitespace.nvim" + use "kylechui/nvim-surround" + use "lewis6991/gitsigns.nvim" + use "nyngwang/NeoZoom.lua" -- TODO: Floating window background color + use "ruifm/gitlinker.nvim" + + use "gruvbox-community/gruvbox" + + if packer_bootstrap then + require('packer').sync() + end +end) diff --git a/tmux/.config/tmux/tmux.conf b/tmux/.config/tmux/tmux.conf index b5fafef..e620262 100644 --- a/tmux/.config/tmux/tmux.conf +++ b/tmux/.config/tmux/tmux.conf @@ -1,6 +1,6 @@ bind-key r source-file ~/.config/tmux/tmux.conf \; display-message " ✱ tmux.conf is reloaded" -set -g default-terminal "alacritty" +set -g default-terminal "xterm-256color" set -ag terminal-overrides ",alacritty:RGB" # for muxception diff --git a/vim/.config/vim/undo/.gitinclude b/vim/.config/vim/undo/.gitinclude deleted file mode 100644 index e69de29..0000000 diff --git a/vim/.vimrc b/vim/.vimrc deleted file mode 100644 index c27c1f5..0000000 --- a/vim/.vimrc +++ /dev/null @@ -1,203 +0,0 @@ -call plug#begin('~/.vim/plugged') - -Plug 'chrisbra/matchit' -Plug 'dhruvasagar/vim-zoom' -Plug 'editorconfig/editorconfig-vim' -Plug 'junegunn/fzf' -Plug 'moll/vim-bbye' -Plug 'ntpeters/vim-better-whitespace' -Plug 'tpope/vim-eunuch' -Plug 'tpope/vim-fugitive' -Plug 'tpope/vim-rhubarb' -Plug 'tpope/vim-surround' - -" languages -Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } -Plug 'hashivim/vim-terraform' -Plug 'rust-lang/rust.vim' -Plug 'tpope/vim-rails' -Plug 'vim-ruby/vim-ruby' - -" colors -Plug 'morhetz/gruvbox' - -call plug#end() - -" STATUS LINE -set statusline= -set statusline+=%<\ %f%{zoom#statusline()} -set statusline+=\ %m%r%y%w%= -set statusline+=\ Line:\ %l\/%L\ [%p%%] -set statusline+=\ Col:\ %v -set statusline+=\ Buf:\ #%n -set statusline+=\ " trailing space - -" SETTINGS -filetype plugin indent on - -set autowrite -set backspace=2 " Backspace over indent, eol, start of insert -set cpoptions+=$ " delimit end of change text -set endofline -set laststatus=2 " always show status line -set nobackup -set noswapfile -set nowrap -set scrolloff=3 -set showmatch -set showmode -set timeoutlen=500 " Don't wait too long (ambiguous leaders) -set virtualedit=all " Cursor can go anywhere -set hlsearch -set ignorecase -set incsearch -set smartcase -set wrapscan - -set number -set relativenumber - -set textwidth=80 -set colorcolumn=80,120 - -" For commands -set infercase -set wildcharm= -set wildignorecase -set wildmenu -set wildmode=list:longest,full - -" Tabs are 2 spaces -set tabstop=2 -set softtabstop=2 -set shiftwidth=2 -set expandtab -set shiftround " make >> go to next tab - -if has('persistent_undo') - set undolevels=5000 - set undofile - - if has('nvim') - set undodir=$HOME/.config/nvim/undo - else - set undodir=$HOME/.vim/undo - endif -endif - -" consistency is key - Y should act like C, D -map Y y$ - -" Don't cancel visual mode while indenting -vnoremap > >gv -vnoremap < - -" LEADERS -let mapleader = "," - -map sz :so ~/.vimrc - -" copy/paste (system buffer) -map cp "+y -map pa "+p - -" tabbing -map 2 :set tabstop=2 softtabstop=2 shiftwidth=2 expandtab -map 4 :set tabstop=4 softtabstop=4 shiftwidth=4 expandtab -map a :set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab -map st :let @/ = "\t" - -" clear search -map cs :let @/ = "" - -" github -map gg :exe "!gh gist create -w %:p" - -" filetype overrides -autocmd Filetype rust set colorcolumn=100 -autocmd BufNewFile,BufRead *.tftpl :set filetype=terraform - -" other -map fj :%!jq . - -" COLOR CONFIGURATION -colorscheme gruvbox - -" NONE is case sensitive in vim here (but not nvim) -autocmd ColorScheme * hi Normal ctermbg=NONE guibg=NONE - -function! ChangeBackground() - let &background=readfile(glob("~/.config/atomaka/color.yml"))[0] -endfunction -call ChangeBackground() - -" Targetting! -augroup Reticle - au! - au VimEnter,WinEnter,BufWinEnter * setlocal cursorline - au WinLeave * setlocal nocursorline - au VimEnter,WinEnter,BufWinEnter * setlocal cursorcolumn - au WinLeave * setlocal nocursorcolumn -augroup END - -" crosshair -set cursorline -set cursorcolumn - -" PLUGIN CONFIGURATION -" editorconfig-vim -let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*'] - -" fzf -let $FZF_DEFAULT_COMMAND = 'ag --hidden --ignore .git -g ""' -noremap :FZF - -" rust.vim -let g:rustfmt_autosave = 1 - -" vim-bbye -nnoremap bd :Bdelete - -" vim-better-whitespace -highlight ExtraWhitespace ctermbg=red -map fw :StripWhitespace - -" vim-eunuch -map sa :Move % - -" vim-fugitive -autocmd FileType fugitiveblame nmap q gq -command! Gblame :G blame -map gb :Git blame -map gh :GBrowse - -" vim-plug -map pc :PlugClean -map pi :PlugInstall -map pu :PlugUpdate - -" vim-terraform -let g:terraform_align=1 - -" zoomwintab.vim -nmap z (zoom-toggle) -nmap (zoom-toggle) -let g:zoom#statustext='Z' -function! MyCtrlW() - let char = nr2char(getchar()) - - if get(t:, 'zoomed', 0) == 1 - if char is# 'v' || char is# 's' || char is# '' || char is# '' - return "" - endif - end - return "\".char -endfunction -nnoremap MyCtrlW()