set nocompatible              " be iMproved, required

filetype off                  " required

 

" set the runtime path to include Vundle and initialize

set rtp+=~/.vim/bundle/Vundle.vim

call vundle#begin()

" alternatively, pass a path where Vundle should install plugins

"call vundle#begin('~/some/path/here')

 

" let Vundle manage Vundle, required

Plugin 'VundleVim/Vundle.vim'

Plugin 'scrooloose/nerdtree' "nerdtree

Plugin 'http://github.com/kien/ctrlp.vim'                                "search file in vim    usage : ctrl + p

Plugin 'tpope/vim-fugitive'                                              "git edit plugin

Plugin 'bling/vim-airline'                                               "하단 상태바(현재상태보여줌) usage : \+q, \+w

Plugin 'rking/ag.vim'                                                    "find keyword at dir , usage : Ag keyword

Plugin 'http://github.com/terryma/vim-multiple-cursors'                  "same keword editing sametime   usage : ctal + n

Plugin 'scrooloose/syntastic'                                            "syntax check usage : lopen

Plugin  'preservim/nerdcommenter'                                        "convinience comment usage : \+c+i, \+c+m <->  \+c+space

Plugin 'posva/vim-vue'

Plugin 'AutoComplPop'

Plugin 'bogado/file-line'

Plugin 'snipMate'

Plugin 'blueyed/vim-diminactive'

Plugin 'edkolev/promptline.vim' "prompt 해주는건데 모르겠음...

Plugin 'SearchComplete' "검색시에 자동완성tab 키 누르면 됨

 

call vundle#end()            " required

filetype plugin indent on    " required

 

이 후 vim 열고 아래 command 입력

:PluginInstall

'Linux > Linux Util' 카테고리의 다른 글

tmux configuration  (0) 2023.05.31
[Linux] Tmux 개요와 사용법  (0) 2023.01.29

# 0 is too far from ` ;)
set -g base-index 1

 

# Automatically set window title
set-window-option -g automatic-rename
off
set-option -g set-titles on

 

#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000

setw -g mode-keys vi
setw -g mode-mouse on
setw -g monitor-activity on

bind-key v split-window -h
bind-key s split-window -v

bind-key J resize-pane -D 5
bind-key K resize-pane -U 5
bind-key H resize-pane -L 5
bind-key L resize-pane -R 5

bind-key M-j resize-pane -D
bind-key M-k resize-pane -U
bind-key M-h resize-pane -L
bind-key M-l resize-pane -R

 

# Vim style pane selection
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

 

# Use Alt-vim keys without prefix key to switch panes
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R

 

# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D

 

# Shift arrow to switch windows
bind -n S-Left  previous-window
bind -n S-Right next-window

 

# No delay for escape key press
set -sg escape-time 0

# Reload tmux config

bind r source-file ~/.tmux.conf

 

# THEME
set -g status-bg black
set -g status-fg white
set -g window-status-current-bg white
set -g window-status-current-fg black
set -g window-status-current-attr bold
set -g status-interval 60
set -g status-left-length 30
set -g status-left '#[fg=green](#S) #(whoami)'
set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'

 

#fix pane name

set-option -g allow-rename off

'Linux > Linux Util' 카테고리의 다른 글

vimrc  (0) 2023.05.31
[Linux] Tmux 개요와 사용법  (0) 2023.01.29

Device tree

  • Device tree  시스템안에 존재하는 device들을 명시하는 노드들로 구성된 tree data structure 의미한다.  노드는  디바이스의 특징들을 표기한 property/ value 쌍으로 이루어져 있다. 디바이스 트리는 루트노드를 제외하고 정확히 하나의 parent 갖는다.

Device tree의 Life Cycle

  •  device tree는 아래 그림과 같은 Life Cycle을 갖는다. 프로그램에도 소스,컴파일러와 바이너리가 있듯이, device tree도 소스인 .dts 파일과 컴파일러인 dtc, 컴파일의 결과물인 .dtb파일이 존재한다.
  • 컴파일에 의해 생성된 .dtb파일은 boot loader에 의해 메모리에 FDT(flattened device tree)형태로 적재되고 이 후에 linux kernel에 의해 expanded DT형태로 변환되어 dt사용자가 API함수(eg. of_function)호출을 통해 dt를 사용할 수 있게 된다.
  • Device driver를 사용하는 입장에서는 dts와 Expanded DT가 어떻게 연관되어 있는지를 알면 dt를 사용할 수 있다.

Life Cycle of device tree

 

Device tree source

  • Device tree source 파일은 dts와 dtsi 등의 여러개의 파일로 구성된다.
  • .dts파일은 최상위 Device tree 파일로, 복 수 개의 .dtsi 파일들을 포함한다.
  • .dtsi 파일에는 SoC-level 정보가 정의되어있는것이 일반적이다.(필수사항은 아니다.)
  • .dts 파일에는 board-level의 정보를 포함하는것이 일반적이다.

Expanded DT format

  • tree 구조
  • of_*() 함수 호출을 통해 접근할 수 있다.
  • 모든 노드가 Linked list로 연결되어 있다.
  • boot가 이루어지는 동안 생성된다.
  • boot 이 후에 Node와 Property가 추가되거나 삭제될 수 있다.
  • 아래 그림은 Expanded DT format의 하나의 node의 정보를 담는 device_node 구조체이다.

트리 순회

  • 좌측 상단의 root node로부터 시작하여 child는 자식노드, Sibling은 같은 레벨에 있는 형제노드, allnext노드는 Depth first로 다음 노드를 가리킨다.
  • 마지막 노드는 allnext 가 NULL pointer를 가리킨다.
 

트리 순회 과정

 

Tmux Introduction

  • Tmux(Terminal multiplexer) shell 환경 저장, 작업하던 디렉토리의 위치, vim 화면을 저장하고 작업할때만 복구해서 사용하고 싶을  유용한 어플리케이션이다. 우분투에서 창을 늘려 사용하는 기능(alt+shift+t) 사용할 뿐만 아니라 vi환경이 아니여도  분할이 가능하고 실수로 터미널을 종료하여도 바로 다시 환경에 접속하여(reattach) 사용할  있다. 터미널 환경을 사용하는 개발자에게 매우 유용한 툴이므로  사용하는것이 좋다.

Tmux resurrect

  • tmux 프로세스이기 떄문에 OS shutdown시키면 환경이 모두 사라진다. (개발서버도 가끔 한번씩은 재부팅을  때가 있다.)  환경을 session단위로 save, restore 가능하게 해주는 app Tmux resurrect이다.

Tmux 구성

  • Session : tmux 실행 단위, 여러 개의 윈도우로 구성
  • Window : 터미널 화면, 세션 내에서 탭처럼 사용 가능 (아래 그림에서 3개의 window 존재)
  • Pane : 하나의 window내에서 화면 분할
  • Status bar : 화면 아래 표시되는 상태 막대

 

Tmux 설치방법

  • sudo apt-get install tmux (ubuntu 계열)

 

Tmux 사용법 (ctrl + b == prefix , $ == prompt)

  • Tmux 실행($tmux new -s '세션이름')
  • Session detach하기(tmux 종료) - prefix , d
  • 현재 tmux 등록된 Session 정보 확인 - $tmux ls
  • 저장된 Session attach하기(tmux 다시 시작) - $tmux attach -t '세션이름'
  • New session 만들기 - prefix, c
  • Window 이름 바꾸기 - prefix, ,(콤마)
  • Window List - prefix , w
  • Window 종료 - $exit (  Last window 닫으면 session 종료된다.)
  • Horizontal 화면분할 prefix, %
  • Vertical 화면분할 prefix , "
  • 분할된 화면 안에서 돌아다니기 - prefix , 방향키 (tmux config 설정에서  변경 가능)
  • 세션 종료 - 해당 Session 프롬프트에서 exit 입력
  • 윈도우 강제 종료 - prefix, &
  • Pane 강제종료 - prefix, x (확인 프롬프트 )
  • 윈도우를 세션으로 바꾸기 prefix, !(세션이 분할된다..)
  • 윈도우  번호로 이동시키기  prefix, :move-window -s [source_num] -t [dest_num]
  • 윈도우 4, 5 swap하기  prefix :swap-window -s 4 -t 5
  •  윈도우 번호 채우기 prefix, :move-window  (1 3 5 -> 1 2 3)으로 바뀜

 

Tmux Resurrect 설치( OS 종료시 날라가는 tmux 정보를 저장하고 되살리는 app)

 

 

Tmux Resurrection 사용법

 ubuntu 14.04 tmux install해서 사용할 경우 tmux 버젼이 1.8이라 위의 플러그인을 사용할  없을 

https://stackoverflow.com/questions/25940944/ugrade-tmux-from-1-8-to-1-9-on-ubuntu-14-04

 

'Linux > Linux Util' 카테고리의 다른 글

vimrc  (0) 2023.05.31
tmux configuration  (0) 2023.05.31

+ Recent posts