Sie sind nicht angemeldet.

1

03.11.2018, 16:21

vim konfigurieren

Hallo,

ich nutze schon immer den Texteditor vim. Als vimrc habe ich ivim https://github.com/kepbod/ivim
Ist ein wirklich ein genialer Ansatz und ich musste mir über die Konfiguration keine Gedanken machen, es hat alles was ich benötige.
Jedoch hätte ich irgendwann wieder selbst die Kontrolle über vim, also plugins aktivieren die ich brauche.
In der Konfiguration von ivim ist mehr vorhanden als ich benötige und einiges Fehlt eben wie zum Beispiel gentoo-syntax usw.

Ich habe mich gefragt, wie aktiviert man plugins die man installiert hat?
Habe gelesen es geht über VIMRUNTIME und habe diese mal auf /usr/share/vim/ gesetzt, aber ich habe das Gefühlt das dass nicht funktioniert hat.

Weiß jemand wie das geht? oder kennt jemand eine Quelle die ich durcharbeiten kann?
knasan

- Bug oder Feature, das darf man sich hier aussuchen. -

2

08.11.2018, 22:00

Ich habe es jetzt fast verstanden wie man Plugins Aktiviert und wie das alles Funktioniert. Und muss sagen, wow, Respekt an alle die Ihre vimrc oder Manager usw. schreiben, es ist wirklich viel Arbeit.
Aber die Arbeit lohnt sich, denn man möchte ja auch die Kontrolle behalten und Schritt für Schritt wächst die vimrc.
Für jeden den dieses Thema Interessiert.

Ich habe folgende vim plugins Installiert.

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
app-vim/bash-support
app-vim/emmet
app-vim/eselect-syntax
app-vim/gentoo-syntax
app-vim/indentpython
app-vim/jedi
app-vim/neocomplcache
app-vim/nerdcommenter
app-vim/nerdtree
app-vim/omnicppcomplete
app-vim/pathogen
app-vim/puppet-syntax
app-vim/rails
app-vim/syntastic
app-vim/vim-autoclose
app-vim/vim-go
app-vim/vim-latex
app-vim/vim-misc
app-vim/vim-spell-de
app-vim/vim-tmux
app-vim/vimpython


Hier meine .vimrc

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
set nocompatible
set title

set number
set ruler
set wrap

set scrolloff=3

" -- Search
set ignorecase
set smartcase

set incsearch
set hlsearch

set visualbell
set noerrorbells

set backspace=indent,eol,start

syntax enable
set background=dark
colorscheme elflord

filetype on
filetype plugin on
filetype indent on


filetype on
filetype plugin on
filetype indent on

"Activate pathogen
call pathogen#infect()

" Activate the NERDTree when ctrl+n
map <C-n> :NERDTree<CR>


"----------------------------------------------------------
" neocomplcache # https://github.com/Shougo/neocomplcache.vim
" Disable AutoComplPop.
let g:acp_enableAtStartup = 0 
" Use neocomplcache.
let g:neocomplcache_enable_at_startup = 1 
" Use smartcase.
let g:neocomplcache_enable_smart_case = 1 
" Set minimum syntax keyword length.
let g:neocomplcache_min_syntax_length = 3 
let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'

" Enable heavy features.
" Use camel case completion.
"let g:neocomplcache_enable_camel_case_completion = 1
" Use underbar completion.
"let g:neocomplcache_enable_underbar_completion = 1

" Define dictionary.
let g:neocomplcache_dictionary_filetype_lists = {
 \ 'default' : '',
 \ 'vimshell' : $HOME.'/.vimshell_hist',
 \ 'scheme' : $HOME.'/.gosh_completions'
 \ }

" Define keyword.
if !exists('g:neocomplcache_keyword_patterns')
 let g:neocomplcache_keyword_patterns = {}
endif
let g:neocomplcache_keyword_patterns['default'] = '\h\w*'

" Plugin key-mappings.
inoremap <expr><C-g> neocomplcache#undo_completion()
inoremap <expr><C-l> neocomplcache#complete_common_string()

" Recommended key-mappings.
" <CR>: close popup and save indent.
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
function! s:my_cr_function()
 return neocomplcache#smart_close_popup() . "\<CR>"
 " For no inserting <CR> key.
 "return pumvisible() ? neocomplcache#close_popup() : "\<CR>"
endfunction
" <TAB>: completion.
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> neocomplcache#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplcache#smart_close_popup()."\<C-h>"
inoremap <expr><C-y> neocomplcache#close_popup()
inoremap <expr><C-e> neocomplcache#cancel_popup()
" Close popup by <Space>.
"inoremap <expr><Space> pumvisible() ? neocomplcache#close_popup() : "\<Space>"


" For cursor moving in insert mode(Not recommended)
"inoremap <expr><Left> neocomplcache#close_popup() . "\<Left>"
"inoremap <expr><Right> neocomplcache#close_popup() . "\<Right>"
"inoremap <expr><Up> neocomplcache#close_popup() . "\<Up>"
"inoremap <expr><Down> neocomplcache#close_popup() . "\<Down>"
" Or set this.
"let g:neocomplcache_enable_cursor_hold_i = 1
" Or set this.
"let g:neocomplcache_enable_insert_char_pre = 1

" AutoComplPop like behavior.
"let g:neocomplcache_enable_auto_select = 1

" Shell like behavior(not recommended).
"set completeopt+=longest
"let g:neocomplcache_enable_auto_select = 1
"let g:neocomplcache_disable_auto_complete = 1
"inoremap <expr><TAB> pumvisible() ? "\<Down>" : "\<C-x>\<C-u>"

" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags

" Enable heavy omni completion.
if !exists('g:neocomplcache_force_omni_patterns')
 let g:neocomplcache_force_omni_patterns = {}
endif
let g:neocomplcache_force_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
let g:neocomplcache_force_omni_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
let g:neocomplcache_force_omni_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'

" For perlomni.vim setting.
" https://github.com/c9s/perlomni.vim
let g:neocomplcache_force_omni_patterns.perl = '\h\w*->\h\w*\|\h\w*::'

"----------------------------------------------------------------------
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0

"-----------------------------------------------------------------------

" JEDI
let g:jedi#auto_initialization = 0
let g:jedi#use_tabs_not_buffers = 1
let g:jedi#use_splits_not_buffers = "left"
let g:jedi#popup_on_dot = 0
let g:jedi#popup_select_first = 0
let g:jedi#show_call_signatures = "1"
let g:pymode_rope = 0
let g:jedi#completions_enabled = 0


Ob syntastic wirklich funktioniert, weiß ich leider nicht, da muss ich mich noch einlesen. Python Code wird (vermutlich) über Jedi geprüft. Jedoch Ruby nicht.
Ich werde mich damit noch etwas beschäftigen. Falls jemand eine spezielle vimrc hat, würde ich mich Freuen wenn diese hier veröffentlicht.
NERDTree wird über Ctrl + n aktiviert.
knasan

- Bug oder Feature, das darf man sich hier aussuchen. -