Coder Social home page Coder Social logo

setup-windows's Introduction

vim setting up windows

1. Buat file configurasi vim di path $HOME extensi _vimrc atau _gvimrc

  • buka vim ketik :echo $HOME disitulah file configurasi vim berada
  • ketik :e _gvimrc atau :e _vimrc

2. Salin sumber kode dibawah ini lalu tempelkan ke file _vimrc atau _gvimrc save file tersebut

syntax on

set autoindent
set backspace=indent,eol,start
set clipboard=unnamed
set encoding=UTF-8
set expandtab
set fileformat=unix
set ignorecase
set incsearch
set nobackup
set nowritebackup
set nocompatible
set noswapfile
set nowrap
set shiftwidth=2
set smartindent
set smarttab
set softtabstop=2
set tabstop=2
"jika anda ingin menghapus file backup yang dibuat secara otomatis oleh vim 
"extensi file: file.txt.un~, file.js.un~ file.html.un~ 
"gunakan perintah ini:
"set undodir="C:\\Users\\USER\\vimfiles\\undodir"
set undofile
set visualbell
set ww=<,>,[,]
set completeopt-=preview
filetype plugin indent on

" untuk gui
if has("gui_running")
  set guifont=Lucida_Console:h11
  " untuk menghilangkan toolbar
  set guioptions-=T
  colorscheme koben
endif

" untuk popup text
function! OmniPopup(action)
  if pumvisible()
    if a:action == 'j'
      return "\<C-N>"
    elseif a:action == 'k'
      return "\<C-P>"
    endif
  endif
  return a:action
endfunction
inoremap <silent>j <C-R>=OmniPopup('j')<CR>
inoremap <silent>k <C-R>=OmniPopup('k')<CR>

"tab complete
function! InsertTabWrapper(direction)
  let col = col('.') - 1
  if !col || getline('.')[col - 1] !~ '\k'
    return "\<tab>"
  elseif "backward" == a:direction
    return "\<c-p>"
  else
    return "\<c-n>"
  endif
endfunction
inoremap <tab> <c-r>=InsertTabWrapper ("forward")<cr>
inoremap <s-tab> <c-r>=InsertTabWrapper ("backward")<cr>

inoremap <expr><C-J> pumvisible() ? "\<C-n>" : "\<C-J>"
inoremap <expr><C-K> pumvisible() ? "\<C-p>" : "\<C-K>"
inoremap <expr><Cr>  pumvisible() ? "\<C-y>" : "\<Cr>"

setup-windows's People

Contributors

kobencry avatar

Watchers

 avatar

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.