shoji


Ⅰ. 插件描述

vim theme that conveys syntax with colorful background highlighting (instead of colored text)

Ⅱ. 基本信息

创建日期:  2018-02-23
使用用户:  2
Github星:  11
插件作者:  nightsense

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'nightsense/shoji'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'nightsense/shoji'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'nightsense/shoji'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/nightsense/shoji

Ⅳ. 文档说明

# shoji logo for the shoji vim theme

A vim theme that conveys syntax with colorful background highlighting (instead of colored text).

Crafted with the magnificent Colortemplate.

variants

The shoji "theme" is actually a pair of themes.

shoji_niji is the exuberant one, showering syntactic rainbows.

screenshot of the shoji_niji vim theme

shoji_shiro is the restrained one, content with pristine black-and-white, except where color is unavoidably practical.

screenshot of the shoji_shiro vim theme

installation

If you don’t have a preferred plugin helper, consider trying vim-plug, which can be installed with:

curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
  https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

With vim-plug, shoji can be installed by adding the following to the top of your vimrc...

call plug#begin('~/.vim/plugged')
Plug 'nightsense/shoji'
call plug#end()

...then restarting vim and running PlugUpdate (from the vim command line).

activation

To activate a shoji theme, add one of the following to your vimrc:

  • colorscheme shoji_niji
  • colorscheme shoji_shiro

A keybinding for the ShojiToggle() function can be used to switch between the two shoji themes:

noremap <C-s> :call ShojiToggle()<return>

Change <C-s> (which denotes the keystroke [ctrl+s]) to suit your preference.

terminal cursor

shape

To set mode-specific cursor shapes in terminal vim, see the vim tips wiki.

For instance, to set cursor shapes in vte-compatible terminals (like urxvt):

let &t_SI = "\<Esc>[6 q"
let &t_SR = "\<Esc>[4 q"
let &t_EI = "\<Esc>[2 q"

This sets the cursor to a vertical line for insert mode, underline for replace mode, and block for normal mode.

color

To set cursor color in (vte-compatible) terminal vim, wrap the vim command in a shell function.

For bash/zsh, add the following to ~/.bashrc or ~/.zshrc:

vim() {
  printf "%b" "\033]11;#fafafa\007\033]12;#2a2a2a\007"
  sh -c "vim $*"
  clear
  printf "%b" "\033]11;#2e3440\007\033]12;#d8dee9\007"
}

For fish, add the following to ~/.config/fish/config.fish:

function vim
  printf "%b" "\033]11;#fafafa\007\033]12;#2a2a2a\007"
  sh -c "vim $argv"
  clear
  printf "%b" "\033]11;#2e3440\007\033]12;#d8dee9\007"
end

Replace 2e3440 and d8dee9 with the background and foreground colors of your terminal theme.

For neovim, substitute vim with nvim.

language samples

These samples (drawn from Rosetta Code) use vim's built-in syntax detection for each filetype.

clojure

screenshot of clojure code highlighted with the shoji_niji vim theme

erlang

screenshot of erlang code highlighted with the shoji_niji vim theme

lisp

screenshot of lisp code highlighted with the shoji_niji vim theme

php

screenshot of php code highlighted with the shoji_niji vim theme

r

screenshot of r code highlighted with the shoji_niji vim theme

rust

screenshot of rust code highlighted with the shoji_niji vim theme

添加新评论