vim-frontend


Ⅰ. 插件描述

:star: Vim Frontend is a Vim configured for Front-end Developers.

Ⅱ. 基本信息

创建日期:  2016-07-21
使用用户:  1
Github星:  259
插件作者:  Victor Igor

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

Vim Frontend: a Vim configured for Front-end Developers.

Licence
asciinema


Is you a Front-end Developer ? Are you using Sublime Text, Atom, Brackets, Visual Studio Code or anything ?

"Give me a chance. Don't worry, I'm easy :smile: " - Vim

Quick demo videos

Installation

If you are using Unix/Linux or Mac OS X.

$ curl https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh > installer.sh
$ sh ./installer.sh {specify the installation directory}

Mac OS X

Pre-requisite:

$ brew install git ctags

Just replace your .vimrc :shipit:

git clone https://github.com/VictorVoid/vim-frontend.git
mv vim-frontend/.vimrc ~/ && mv vim-frontend/autoload/ ~/.vim && mv vim-frontend/ultisnips/ ~/.vim

or

- Download ZIP
cd /Users/yourusername/Download
- Open terminal
unzip vim-frontend-master.zip
mv vim-frontend/.vimrc ~/ && mv vim-frontend/autoload/ ~/.vim && mv vim-frontend/ultisnips/ ~/.vim

YouCompleteMe Plugin INFO: :ear:

Remember: YCM is a plugin with a compiled component. If you update YCM
using Vundle and the ycm_core library APIs have changed (happens
rarely), YCM will notify you to recompile it. You should then rerun the install
process.

Don't worry, it's easy :smile: Let's go.

Install Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install cmake via Homebrew

brew install cmake

Compiling YCM with semantic support for C-family languages:

cd  ~/.cache/dein/repos/github.com/Valloric/YouCompleteMe
./install.py --clang-completer

More info

Linux x64

Pre-requisite:

  • UbuntuDebian
$ sudo apt-get install git exuberant-ctags ncurses-term python-jinja2
  • Gentoo
$ sudo emerge dev-util/ctags sys-libs/ncurses dev-vcs/git dev-python/pyflakes dev-python/jinja
  • Arch Linux via pacman (recomend used pacaur)
$ sudo pacman -S git-core ctags ncurses python-jinja
  • Fedora
$ sudo dnf install ncurses-devel git ctags-etags

Just replace your .vimrc :shipit:

git clone https://github.com/VictorVoid/vim-frontend.git
mv vim-frontend/.vimrc ~/ && mv vim-frontend/autoload/ ~/.vim && mv vim-frontend/ultisnips/ ~/.vim

or

- Download ZIP
cd /Users/yourusername/Download
- Open terminal
sudo apt-get install unzip
unzip file.zip -d
mv vim-frontend/.vimrc ~/ && mv vim-frontend/autoload/ ~/.vim && mv vim-frontend/ultisnips/ ~/.vim

YouCompleteMe Plugin INFO: :ear:

Remember: YCM is a plugin with a compiled component. If you update YCM
using Vundle and the ycm_core library APIs have changed (happens
rarely), YCM will notify you to recompile it. You should then rerun the install
process.

UbuntuDebian:

Install development tools and CMake: sudo apt-get install build-essential cmake

Make sure you have Python headers installed: `sudo apt-get install python-dev
python3-dev`.

Compiling YCM with semantic support for C-family languages:

cd ~/.cache/dein/repos/github.com/Valloric/YouCompleteMe
./install.py --clang-completer

Other distribution
More info

Features Summary

  • Automatic syntax and codestyle checks.
  • JavaScript autocomplete (ternjs)
  • HTML with auto close tag
  • Integration with Git
  • Emmet
  • Snippets
  • TagBar (overview of its structure)
  • Vim Session (restore your Vim editing sessions)
  • Surround (provides mappings to easily delete, change and add such surroundings in pairs)
  • Integration with CSS Pre-processors (SASS, LESS and Stylus)
  • Color preview (css/less/sass/stylus/html)
  • Beautify (HTML, CSS, JS)

User Guide

General Commands

Git

CommandsDescriptions
<space>gaExecute git add on current file
<space>gcgit commit (splits window to write commit message)
<space>gshgit push
<space>gllgit pull
<space>gsgit status
<space>gbgit blame
<space>gdgit diff
<space>grgit remove

Find buffers and file

CommandsDescriptions
<space>sFind and open files
<space>bFind file on buffer (open file)
<space>cClose active buffer (clone file)

Navigations

CommandsDescriptions
<space>.Set path working directory
:cd <path>Open path /path
<Control>+w+wAlternative navigate vim split panels
<space>w or <space>xNext buffer navigate
<space>q or <space>zprevious buffer navigate
SHIFT+nCreate a tab
SHIFT+TABprevious tab navigate
TABnext tab navigate
<Control+w>+<hjkl>Navigate via split panels
F2Open tree navigate in actual opened file
F3Open/Close tree navigate files
F4List all class and method, support for python, go, lua, ruby and php
<space>+0Focus on tree navigate files

Sessions

CommandsDescriptions
<space>soOpen Session
<space>ssSave Session
<space>sdDelete Session
<space>scClose Session

Code

CommandsDescriptions
>indent to right
<indent to left
gcComment or uncomment lines that {motion} moves over
YYCopy to clipboard
<space>pPaste
<Control+l>UltiSnips Expand Trigger
<Control+y>,Activate Emmet plugin

Splits

CommandsDescriptions
<space>vSplit vertical
<space>hSplit horizontal

Learning Vim

You can learn basic vim here:

Super Fast Navigation

CommandsDescriptions
eMove to the end of a word
w:arrow_right: Move forward to the beginning of a word ->
W:arrow_right: Move forward a WORD (any non-whitespace characters)
b:arrow_left: Move backward to the beginning of a word
(:arrow_down: Jump backward one sentence
):arrow_up: Jump forward one sentence.
3w, 3b:left_right_arrow: Move forward three words, Move backward three words
$Move to the end of the line
0"Move to the beginning of the line
HJump to the top of the screen
MJump to the middle of the screen
LJump to the bottom of the screen
mxSet mark x at the current cursor position
'xJump to the beginning of the line of mark x
`xJump to the cursor position of mark x
HTML Visual NavigationDescriptions
atSelect the outer tag block by pressing
itSelect the inner tag block

HTML Commands

asciicast

CommandsDescriptions
html5+<ctrl l>snippet html tree
css+<ctrl l>snippet link css
ysiwwrap tag in word
ysswrap the entire line
cst <updatetag>change tag to update tag
cs"'change " to '
ds"remove the delimiters entirely
dst"remove the delimiters entirely (t == tag)

Navigating HTML tags in Vim

  1. Enter visual mode
  2. Select the outer tag block by pressing a + t or i + t for inner tag block.

JavaScript Commands

JavaScript ES6 React

asciicast

vf

var functioname = function (arg){
    //
}

**

/**
*
**/

ex


module.exports = yourmod

css


{yourobj}.css('atribuite', 'value')

qs


document.querySelector('selector')

document.querySelectorAll('selector') //qsa

trf


try {

} catch (e) {

} finally {

}

proto


class_name.prototype.method_name = function(){
    
}

props


var my_object = Object.defineProperties{
    new Object(),
    {
        property: {
            get: function my_object_property_getter(){
            
            },
            set: function my_object_property_setter(value){
            
            },
            value       : value,
            writeable   : boolean,
            enumerable  : boolean,
            configurable: boolean
        }
    }
}

us

'use strict';

=>


( ) => {

}

cla


Class classname{


}

clax

Class classname extends classname{

}

imp

import ModuleName from 'ModuleName'

cc


const app = React.createClass({
    render: function(){
    
    }
})

cdm


componentDidMount: function(){

},

gis

getInitialState: function(){
    return {
    
    };
},

AngularJS 1 e 2

asciicast

CommandsDirective
nang-app=""
ncng-click=""
nctrlng-controller=""
nclng-class=""
nmng-model=""
nsng-show=""
nhng-hide=""
nbng-bind=""
{{{{}}
n2c(click)=""
n2dbc(dblclick)=""
n2ctrlngController=""
n2m[(ngModel)]=""
n2cl[ngClass]=""

ngsa

 <script src="https://ajax.googleapis.com/ajax/libs/angularjs/x.x.xx/angular.js"></script> 

$v

$scope.variable = value;

ngc

var controllerName = function(scope, injectables){

};

ngfor

angularforEach(iterateOver, function(value, key){
    
});

ngm

angular.module('moduleName', [moduleDependencies]);

ngma

var moduleName = angular.module('moduleName', [moduleDeps]);

ngmfa

factory('factoryName', function(dependencies){

});

ngms

service('serviceName', function(injectables){

});

ngmfi

filter('filterName', function(injectables){
    return function(inputs, args){
    
    };
});

ngrwr


$routeProvider.when('url', {
    templateUrl: 'templateUrl',
    controller: 'controller',
    resolve: {
    
    }
});

ngro

$routeProvider.otherwise({
    redirectTo: 'url'
});

TypeScript

Snippets from Martin Prins

ng2-component-root  // Angular 2 root App component
ng2-bootstrap     // Angular 2 bootstraping, for main.ts
ng2-component     // Angular 2 component
ng2-pipe          // Angular 2 pipe
ng2-route-config  // Angular 2 @RouteConfig
ng2-route-path    // Angular 2 routing path
ng2-service       // Angular 2 service
ng2-subscribe     // Angular 2 observable subscription

CSS Commands

CSS Abbreviations

添加新评论