3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

あまり使い込んでないcygwin環境備忘録

Last updated at Posted at 2015-08-07

忘れないうちにメモ

.bashrc
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# User specific aliases and functions

alias cp='cp -i'
alias rm='rm -i'
alias ls='ls --color=auto'
alias ll='ls -l'
PS1='[\[\e]0;\w\a\]\[\e[32m\]\u@\h \[\e[33m\]\W\[\e[0m\]]\$ '

sakura() { "/cygdrive/c/Program Files/sakura/sakura.exe" $(winpath $1) & }
win() { explorer $(winpath $1); }

cygwinパスからwindowsパスへの変換。
最初はゴリゴリと変換してたんですが、コメントで指摘され cygpath をベースにした物に変更。
引数がからっぽの時に適当に対処するだけ。 どうせワンラインに収まるので .bashrc に一緒に書いてもよかったかもしれない。

winpath
#!/bin/bash

if [  -z $1 ] ;then
  echo $(cygpath -w $(pwd))
else
  echo $(cygpath -w $1)
fi

ぼくのかんがえたさいしょうのvimrc を参考に

.vimrc

" 行頭・行末移動方向をキーの相対位置にあわせる
nnoremap 0 $ 
nnoremap 1 0 

" 挿入モードでのカーソル移動
inoremap <C-j> <Down>
inoremap <C-k> <Up>
inoremap <C-h> <Left>
inoremap <C-l> <Right>

" シンタックスの有効化
syntax enable

" タブまわりとか
set number
set ruler
set list
set listchars=tab:>-,trail:-,nbsp:%,extends:>,precedes:<,eol:<
set incsearch
set hlsearch
set nowrap
set showmatch
set whichwrap=h,l
set nowrapscan
set ignorecase
set smartcase
set hidden
set history=2000
set autoindent
set expandtab
set tabstop=2
set shiftwidth=2
set helplang=en

colorscheme desert

3
3
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?