Coder Social home page Coder Social logo

.vim's Introduction

  1. Installation

1.1. Linux

    git clone https://github.com/hinikato/.vim.git ~/.vim
    cd ~/.vim && chmod +x *.sh && source vim-init.sh

1.2. Windows

  1. Run the following commands (you can do the same commands by other way or you can install the DevKit: https://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe):
    git clone https://github.com/hinikato/.vim.git $VIM/vimfiles
    cp $VIM/vimfiles/.vimrc $VIM
    cp $VIM/vimfiles/.gvimrc $VIM

where $VIM variable should be replaced with path where the gvim.exe executable can be found. You can find it with the following command:

    :echo $VIM

This command should be executed in Vim.

  1. After that run the following commands:
    cd $VIM/vimfiles
    git submodule update --init
  1. Keys

Keys Description Mode
, Leader key Mode independent
Ctrl+k Move line up (author Skip) Insert, Normal
Ctrl+j Move line down (author Skip) Insert, Normal
Ctrl+s Save current file Insert, Normal
Alt+h Move cursor to the left window Normal
Alt+j Move cursor to the below window Normal
Alt+k Move cursor to the above window Normal
Alt+l Move cursor to the right window. Normal
F2 Show NERDTree explorer in the left window. Normal
F3 Save file and strip trailing spaces at the end of lines. Normal
F4 Search for bootstrap.php file in the current directory and if not found in subdirectories recursively and run the
phpunit --bootstrap bootstrap.php current_file.php
command.
Normal
F5 Run the python, php, node or dart with current file as argument. Insert, Normal, Command-line
Ctrl+Enter Paste of the selected text to the command line Normal
Ctrl+Tab Next tab Insert, Normal
Ctrl+Shift+Tab Previous tab Insert, Normal
  1. Language switcher fix (Windows only)

In the bundle/myak/myak.vim there is the following block of code:

fun! <SID>lib_kb_switch(mode)
  let dll_file_path = s:this_dir_path . '/libdxlsw' . (has('win64') ? '64' : '') . '.dll'
  let cur_layout = libcallnr(dll_file_path, 'dxGetLayout', 0)
  if a:mode == 0
  if cur_layout != 1033
    call libcallnr(dll_file_path, 'dxSetLayout', 1033)
  endif
    let b:lib_kb_layout = cur_layout
  elseif a:mode == 1
    if exists('b:lib_kb_layout') && b:lib_kb_layout != cur_layout
      call libcallnr(dll_file_path, 'dxSetLayout', b:lib_kb_layout)
    endif
  endif
endfun
if myak#is_win()
  autocmd InsertEnter * call <SID>lib_kb_switch(1)
  autocmd InsertLeave * call <SID>lib_kb_switch(0)
endif

It responsible for switching language to English when Vim enters to the Insert mode and for the restoring previos language back when Vim leaves the Insert mode. To allow it work we use the .dll file that has been attached to the following article (ru language).

This approach don't work for the Ctrl-[ combination, so additional fix must be applied, using the following AutoHotkey script:

; If you don't need switch keyboard with Caps Lock just comment out
; the next 3 lines below.
CapsLock::Send, {Alt Down}{Shift Down}{Shift Up}{Alt Up}
return

!CapsLock::CapsLock

; The $ prevents AutoHotkey from confusing sent keystrokes (via Send commands) with keypresses made by the user.
; If we didn't put that, we would get an infinite loop,
; see http://stackoverflow.com/questions/15840608/autohotkey-send-default-behavior-if-condition-not-met 
; The ^ means Ctrl
; The :: means execute next command.
$^[::
if WinActive("ahk_class Vim") {
    Send {Esc}
} else {
    Send ^[
}

return

Just compile it with the Ahk2Exe.exe (it included in the AutoHotkey installation) and ensure that the produced .exe is autoloaded during Windows boot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.