manjaro installation guide
20180214 update:
第一个版本已经比较久了,于是更新一下,顺便写了个脚本orz
1
2 pacman-mirrors -c China
3 echo " [archlinuxcn] " >> /etc/pacman.conf
4 echo " SigLevel = Optional TrustedOnly " >> /etc/pacman.conf
5 echo " Server = https://mirrors.ustc.edu.cn/archlinuxcn/\$arch" >> /etc/pacman.conf
6
7
8 echo "[arch4edu]" >> /etc/pacman.conf
9 echo "SigLevel = Never" >> /etc/pacman.conf
10 echo "Server = http://mirrors.tuna.tsinghua.edu.cn/arch4edu/\$arch " >> /etc/pacman.conf
11 pacman -Syyu
12 pacman -S archlinuxcn-keyring
13
14 pacman -S yakuake fish gvim
15 pacman -S google-chrome chromium
16 pacman -S wget aria2 remarkable netease-cloud-music
17 pacman -S fcitx fcitx-configtool fcitx-sogoupinyin fcitx-im kcm-fcitx
18 pacman -S shadowsocks-qt5
19 pacman -S wqy-microhei wqy-microhei-lite wqy-bitmapfont wqy-zenhei ttf-arphic-ukai ttf-arphic-uming adobe-source-han-sans-cn-fonts
20
21 cat >> ~/.xprofile <<EOF
22 export GTK_IM_MODULE=fcitx
23 export QT_IM_MODULE=fcitx
24 export XMODIFIERS="@im=fcitx"
25 EOF
26
出于目前对manjaro的依赖,以及没有找到很简单易行的备份系统的方案的原因,决定详细记录一下系统安装的过程,以防哪天系统挂掉了,可以快速恢复。
1.关于更换源
坑点主要在系统默认的源是国外源,如何切换成中国源,网上有很多教程,但这些教程都是针对Arch的,弄来弄去也很不容易搞好,而且胡乱修改会把Manjaro的源破坏掉(不要问我怎么知道的)。 其实网上有个blog的方法很方便,附上连接
就两行命令搞定:
1
2 sudo pacman-mirrors -c China //选择中国源并更新
3 sudo pacman -Syyu //更新系统
4
2.安装搜狗输入法
具体为,安装fcitx,安装fcitx-sogoupinyin,安装kcm-fcitx
然后
~/.xprofile 文件中添加如下内容
1
2
3
4 export GTK_IM_MODULE=fcitx
5 export QT_IM_MODULE=fcitx
6 export XMODIFIERS="@im=fcitx"
由于初始安装系统时选择的是英文,在安装搜狗输入法之前先安装了chrome,导致在chrome中无法输入中文(而在firefox中可以),解决办法时,删除掉.config中google-chrome文件夹即可
3 添加archlinuxcn源
在 /etc/pacman.conf
文件末尾添加以下两行:
[archlinuxcn]
SigLevel = Optional TrustedOnly
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch
之后安装 archlinuxcn-keyring 包以导入 GPG key。
4 添加arch4edu源
在/etc/pacman.conf 文件末尾添加
[arch4edu]
SigLevel = Never
Server = http://mirrors.tuna.tsinghua.edu.cn/arch4edu/$arch
5 安装常用软件()
* guake
* fish
* vim
* shadowsockq-qt5
* google-chrome
* wget,aria2
* franz,telegram-desktop
* remarkable (markdown编辑器,轻量级)
6.proxychains-ng
1
2 dynamic_chain
3 chain_len = 1
4 proxy_dns
5 remote_dns_subnet 224
6 tcp_read_time_out 15000
7 tcp_connect_time_out 8000
8 [ProxyList]
9 socks5 127.0.0.1 1080
10
11
就很气,配置文件经常失效,再记录一份好了
1 quiet_mode
2 dynamic_chain
3 chain_len = 1 #round_robin_chain和random_chain使用
4 proxy_dns
5 remote_dns_subnet 224
6 tcp_read_time_out 15000
7 tcp_connect_time_out 8000
8 localnet 127.0.0.0/255.0.0.0
9 localnet 10.0.0.0/255.0.0.0
10 localnet 172.16.0.0/255.240.0.0
11 localnet 192.168.0.0/255.255.0.0
12
13 [ProxyList]
14 socks5 127.0.0.1 1080
15 http 127.0.0.1 1087
16
7 vim 配置
8修改键盘映射
1 keysym XF86Back = Page_Up
2 keysym XF86Forward = Page_Down
3
9安装中文字体:
1
2 sudo pacman -S wqy-microhei wqy-microhei-lite wqy-bitmapfont wqy-zenhei ttf-arphic-ukai ttf-arphic-uming adobe-source-han-sans-cn-fonts
3
- anaconda with fish
anaconda 默认的环境变量是bash,对于fish,需要修改~/.config/fish/config.fish 如下
1
2 #export LD_LIBRARY_PATH=/usr/local/cuda/lib64/
3 set -x LD_LIBRARY_PATH /usr/local/cuda/lib64/
4
5 # added by Anaconda2 4.4.0 installer
6 #export PATH="/home/sensetime/anaconda2/bin:$PATH"
7 set -x PATH /home/sensetime/anaconda2/bin $PATH
8
11 youcompleteme
1
2 # This file is NOT licensed under the GPLv3, which is the license for the rest
3 # of YouCompleteMe.
4 #
5 # Here's the license text for this file:
6 #
7 # This is free and unencumbered software released into the public domain.
8 #
9 # Anyone is free to copy, modify, publish, use, compile, sell, or
10 # distribute this software, either in source code form or as a compiled
11 # binary, for any purpose, commercial or non-commercial, and by any
12 # means.
13 #
14 # In jurisdictions that recognize copyright laws, the author or authors
15 # of this software dedicate any and all copyright interest in the
16 # software to the public domain. We make this dedication for the benefit
17 # of the public at large and to the detriment of our heirs and
18 # successors. We intend this dedication to be an overt act of
19 # relinquishment in perpetuity of all present and future rights to this
20 # software under copyright law.
21 #
22 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25 # IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
26 # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
27 # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28 # OTHER DEALINGS IN THE SOFTWARE.
29 #
30 # For more information, please refer to <http://unlicense.org/>
31
32 import os
33 import ycm_core
34
35 # These are the compilation flags that will be used in case there's no
36 # compilation database set (by default, one is not set).
37 # CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
38 flags = [
39 '-Wall',
40 '-Wextra',
41 '-Werror',
42 '-Wnoc++98-compat',
43 '-Wno-long-long',
44 '-Wno-variadic-macros',
45 '-fexceptions',
46 '-DNDEBUG',
47 #'-stdlib=libc++',
48 # You 100% do NOT need -DUSE_CLANG_COMPLETER in your flags; only the YCM
49 # source code needs it.
50 '-DUSE_CLANG_COMPLETER',
51 # THIS IS IMPORTANT! Without a "-std=<something>" flag, clang won't know which
52 # language to use when compiling headers. So it will guess. Badly. So C++
53 # headers will be compiled as C headers. You don't want that so ALWAYS specify
54 # a "-std=<something>".
55 # For a C project, you would set this to something like 'c99' instead of
56 # 'c++11'.
57 '-std=c++11',
58 # ...and the same thing goes for the magic -x option which specifies the
59 # language that the files to be compiled are written in. This is mostly
60 # relevant for c++ headers.
61 # For a C project, you would set this to 'c' instead of 'c++'.
62 '-x',
63 'c++',
64 '-isystem',
65 '../BoostParts',
66 '-isystem',
67 # This path will only work on OS X, but extra paths that don't exist are not
68 # harmful
69 '/System/Library/Frameworks/Python.framework/Headers',
70 '-isystem',
71 '../llvm/include',
72 '-isystem',
73 '../llvm/tools/clang/include',
74 '-I',
75 '.',
76 '-I',
77 './ClangCompleter',
78 '-isystem',
79 './tests/gmock/gtest',
80 '-isystem',
81 './tests/gmock/gtest/include',
82 '-isystem',
83 './tests/gmock',
84 '-isystem',
85 './tests/gmock/include',
86 #'-isystem',
87 #'/usr/local/include/c++/5.1.0',
88 #'-isystem',
89 #'/usr/local/include',
90 #'-isystem',
91 #'/usr/include',
92 ]
93
94
95 # Set this to the absolute path to the folder (NOT the file!) containing the
96 # compile_commands.json file to use that instead of 'flags'. See here for
97 # more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
98 #
99 # You can get CMake to generate this file for you by adding:
100 # set( CMAKE_EXPORT_COMPILE_COMMANDS 1 )
101 # to your CMakeLists.txt file.
102 #
103 # Most projects will NOT need to set this to anything; you can just change the
104 # 'flags' list of compilation flags. Notice that YCM itself uses that approach.
105 compilation_database_folder = ''
106
107 if os.path.exists( compilation_database_folder ):
108 database = ycm_core.CompilationDatabase( compilation_database_folder )
109 else:
110 database = None
111
112 SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ]
113
114 def DirectoryOfThisScript():
115 return os.path.dirname( os.path.abspath( __file__ ) )
116
117
118 def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
119 if not working_directory:
120 return list( flags )
121 new_flags = []
122 make_next_absolute = False
123 path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
124 for flag in flags:
125 new_flag = flag
126
127 if make_next_absolute:
128 make_next_absolute = False
129 if not flag.startswith( '/' ):
130 new_flag = os.path.join( working_directory, flag )
131
132 for path_flag in path_flags:
133 if flag == path_flag:
134 make_next_absolute = True
135 break
136
137 if flag.startswith( path_flag ):
138 path = flag[ len( path_flag ): ]
139 new_flag = path_flag + os.path.join( working_directory, path )
140 break
141
142 if new_flag:
143 new_flags.append( new_flag )
144 return new_flags
145
146
147 def IsHeaderFile( filename ):
148 extension = os.path.splitext( filename )[ 1 ]
149 return extension in [ '.h', '.hxx', '.hpp', '.hh' ]
150
151
152 def GetCompilationInfoForFile( filename ):
153 # The compilation_commands.json file generated by CMake does not have entries
154 # for header files. So we do our best by asking the db for flags for a
155 # corresponding source file, if any. If one exists, the flags for that file
156 # should be good enough.
157 if IsHeaderFile( filename ):
158 basename = os.path.splitext( filename )[ 0 ]
159 for extension in SOURCE_EXTENSIONS:
160 replacement_file = basename + extension
161 if os.path.exists( replacement_file ):
162 compilation_info = database.GetCompilationInfoForFile(
163 replacement_file )
164 if compilation_info.compiler_flags_:
165 return compilation_info
166 return None
167 return database.GetCompilationInfoForFile( filename )
168
169
170 def FlagsForFile( filename, **kwargs ):
171 if database:
172 # Bear in mind that compilation_info.compiler_flags_ does NOT return a
173 # python list, but a "list-like" StringVec object
174 compilation_info = GetCompilationInfoForFile( filename )
175 if not compilation_info:
176 return None
177
178 final_flags = MakeRelativePathsInFlagsAbsolute(
179 compilation_info.compiler_flags_,
180 compilation_info.compiler_working_dir_ )
181
182 # NOTE: This is just for YouCompleteMe; it's highly likely that your project
183 # does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR
184 # ycm_extra_conf IF YOU'RE NOT 100% SURE YOU NEED IT.
185 try:
186 final_flags.remove( '-stdlib=libc++' )
187 pass
188 except ValueError:
189 pass
190 else:
191 relative_to = DirectoryOfThisScript()
192 final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
193
194 return {
195 'flags': final_flags,
196 'do_cache': True
197 }
198
199
12.关于vim 剪贴板的问题
How do I use the system clipboard with Vim in Arch Linux?
uninstall vim,install gvim,and use vim instead of gvim
13 vim 配色文件molokai.vim(透明背景修改
1
2 " Vim color file
3 "
4 " Author: Tomas Restrepo <tomas@winterdom.com>
5 " https://github.com/tomasr/molokai
6 "
7 " Note: Based on the Monokai theme for TextMate
8 " by Wimer Hazenberg and its darker variant
9 " by Hamish Stuart Macpherson
10 "
11
12 hi clear
13
14 if version > 580
15 " no guarantees for version 5.8 and below, but this makes it stop
16 " complaining
17 hi clear
18 if exists("syntax_on")
19 syntax reset
20 endif
21 endif
22 let g:colors_name="molokai"
23
24 if exists("g:molokai_original")
25 let s:molokai_original = g:molokai_original
26 else
27 let s:molokai_original = 0
28 endif
29
30
31 hi Boolean guifg=#AE81FF
32 hi Character guifg=#E6DB74
33 hi Number guifg=#AE81FF
34 hi String guifg=#E6DB74
35 hi Conditional guifg=#F92672 gui=bold
36 hi Constant guifg=#AE81FF gui=bold
37 hi Cursor guifg=#000000 guibg=#F8F8F0
38 hi iCursor guifg=#000000 guibg=#F8F8F0
39 hi Debug guifg=#BCA3A3 gui=bold
40 hi Define guifg=#66D9EF
41 hi Delimiter guifg=#8F8F8F
42 hi DiffAdd guibg=#13354A
43 hi DiffChange guifg=#89807D guibg=#4C4745
44 hi DiffDelete guifg=#960050 guibg=#1E0010
45 hi DiffText guibg=#4C4745 gui=italic,bold
46
47 hi Directory guifg=#A6E22E gui=bold
48 hi Error guifg=#E6DB74 guibg=#1E0010
49 hi ErrorMsg guifg=#F92672 guibg=#232526 gui=bold
50 hi Exception guifg=#A6E22E gui=bold
51 hi Float guifg=#AE81FF
52 hi FoldColumn guifg=#465457 guibg=#000000
53 hi Folded guifg=#465457 guibg=#000000
54 hi Function guifg=#A6E22E
55 hi Identifier guifg=#FD971F
56 hi Ignore guifg=#808080 guibg=bg
57 hi IncSearch guifg=#C4BE89 guibg=#000000
58
59 hi Keyword guifg=#F92672 gui=bold
60 hi Label guifg=#E6DB74 gui=none
61 hi Macro guifg=#C4BE89 gui=italic
62 hi SpecialKey guifg=#66D9EF gui=italic
63
64 hi MatchParen guifg=#000000 guibg=#FD971F gui=bold
65 hi ModeMsg guifg=#E6DB74
66 hi MoreMsg guifg=#E6DB74
67 hi Operator guifg=#F92672
68
69 " complete menu
70 hi Pmenu guifg=#66D9EF guibg=#000000
71 hi PmenuSel guibg=#808080
72 hi PmenuSbar guibg=#080808
73 hi PmenuThumb guifg=#66D9EF
74
75 hi PreCondit guifg=#A6E22E gui=bold
76 hi PreProc guifg=#A6E22E
77 hi Question guifg=#66D9EF
78 hi Repeat guifg=#F92672 gui=bold
79 hi Search guifg=#000000 guibg=#FFE792
80 " marks
81 hi SignColumn guifg=#A6E22E guibg=#232526
82 hi SpecialChar guifg=#F92672 gui=bold
83 hi SpecialComment guifg=#7E8E91 gui=bold
84 hi Special guifg=#66D9EF guibg=bg gui=italic
85 if has("spell")
86 hi SpellBad guisp=#FF0000 gui=undercurl
87 hi SpellCap guisp=#7070F0 gui=undercurl
88 hi SpellLocal guisp=#70F0F0 gui=undercurl
89 hi SpellRare guisp=#FFFFFF gui=undercurl
90 endif
91 hi Statement guifg=#F92672 gui=bold
92 hi StatusLine guifg=#455354 guibg=fg
93 hi StatusLineNC guifg=#808080 guibg=#080808
94 hi StorageClass guifg=#FD971F gui=italic
95 hi Structure guifg=#66D9EF
96 hi Tag guifg=#F92672 gui=italic
97 hi Title guifg=#ef5939
98 hi Todo guifg=#FFFFFF guibg=bg gui=bold
99
100 hi Typedef guifg=#66D9EF
101 hi Type guifg=#66D9EF gui=none
102 hi Underlined guifg=#808080 gui=underline
103
104 hi VertSplit guifg=#808080 guibg=#080808 gui=bold
105 hi VisualNOS guibg=#403D3D
106 hi Visual guibg=#403D3D
107 hi WarningMsg guifg=#FFFFFF guibg=#333333 gui=bold
108 hi WildMenu guifg=#66D9EF guibg=#000000
109
110 hi TabLineFill guifg=#1B1D1E guibg=#1B1D1E
111 hi TabLine guibg=#1B1D1E guifg=#808080 gui=none
112
113 if s:molokai_original == 1
114 hi Normal guifg=#F8F8F2 guibg=NONE
115 hi Comment guifg=#75715E
116 hi CursorLine guibg=#3E3D32
117 hi CursorLineNr guifg=#FD971F gui=none
118 hi CursorColumn guibg=#3E3D32
119 hi ColorColumn guibg=#3B3A32
120 hi LineNr guifg=#BCBCBC guibg=#3B3A32
121 hi NonText guifg=#75715E
122 hi SpecialKey guifg=#75715E
123 else
124 hi Normal guifg=#F8F8F2 guibg=NONE
125 hi Comment guifg=#7E8E91
126 hi CursorLine guibg=#293739
127 hi CursorLineNr guifg=#FD971F gui=none
128 hi CursorColumn guibg=#293739
129 hi ColorColumn guibg=#232526
130 hi LineNr guifg=#465457 guibg=#232526
131 hi NonText guifg=#465457
132 hi SpecialKey guifg=#465457
133 end
134
135 "
136 " Support for 256-color terminal
137 "
138 if &t_Co > 255
139 if s:molokai_original == 1
140 hi Normal ctermbg=NONE
141 hi CursorLine ctermbg=235 cterm=none
142 hi CursorLineNr ctermfg=208 cterm=none
143 else
144 hi Normal ctermfg=252 ctermbg=NONE
145 hi CursorLine ctermbg=234 cterm=none
146 hi CursorLineNr ctermfg=208 cterm=none
147 endif
148 hi Boolean ctermfg=135
149 hi Character ctermfg=144
150 hi Number ctermfg=135
151 hi String ctermfg=144
152 hi Conditional ctermfg=161 cterm=bold
153 hi Constant ctermfg=135 cterm=bold
154 hi Cursor ctermfg=16 ctermbg=253
155 hi Debug ctermfg=225 cterm=bold
156 hi Define ctermfg=81
157 hi Delimiter ctermfg=241
158
159 hi DiffAdd ctermbg=24
160 hi DiffChange ctermfg=181 ctermbg=239
161 hi DiffDelete ctermfg=162 ctermbg=53
162 hi DiffText ctermbg=102 cterm=bold
163
164 hi Directory ctermfg=118 cterm=bold
165 hi Error ctermfg=219 ctermbg=89
166 hi ErrorMsg ctermfg=199 ctermbg=16 cterm=bold
167 hi Exception ctermfg=118 cterm=bold
168 hi Float ctermfg=135
169 hi FoldColumn ctermfg=67 ctermbg=16
170 hi Folded ctermfg=67 ctermbg=16
171 hi Function ctermfg=118
172 hi Identifier ctermfg=208 cterm=none
173 hi Ignore ctermfg=244 ctermbg=232
174 hi IncSearch ctermfg=193 ctermbg=16
175
176 hi keyword ctermfg=161 cterm=bold
177 hi Label ctermfg=229 cterm=none
178 hi Macro ctermfg=193
179 hi SpecialKey ctermfg=81
180
181 hi MatchParen ctermfg=233 ctermbg=208 cterm=bold
182 hi ModeMsg ctermfg=229
183 hi MoreMsg ctermfg=229
184 hi Operator ctermfg=161
185
186 " complete menu
187 hi Pmenu ctermfg=81 ctermbg=16
188 hi PmenuSel ctermfg=255 ctermbg=242
189 hi PmenuSbar ctermbg=232
190 hi PmenuThumb ctermfg=81
191
192 hi PreCondit ctermfg=118 cterm=bold
193 hi PreProc ctermfg=118
194 hi Question ctermfg=81
195 hi Repeat ctermfg=161 cterm=bold
196 hi Search ctermfg=0 ctermbg=222 cterm=NONE
197
198 " marks column
199 hi SignColumn ctermfg=118 ctermbg=235
200 hi SpecialChar ctermfg=161 cterm=bold
201 hi SpecialComment ctermfg=245 cterm=bold
202 hi Special ctermfg=81
203 if has("spell")
204 hi SpellBad ctermbg=52
205 hi SpellCap ctermbg=17
206 hi SpellLocal ctermbg=17
207 hi SpellRare ctermfg=none ctermbg=none cterm=reverse
208 endif
209 hi Statement ctermfg=161 cterm=bold
210 hi StatusLine ctermfg=238 ctermbg=253
211 hi StatusLineNC ctermfg=244 ctermbg=232
212 hi StorageClass ctermfg=208
213 hi Structure ctermfg=81
214 hi Tag ctermfg=161
215 hi Title ctermfg=166
216 hi Todo ctermfg=231 ctermbg=232 cterm=bold
217
218 hi Typedef ctermfg=81
219 hi Type ctermfg=81 cterm=none
220 hi Underlined ctermfg=244 cterm=underline
221
222 hi VertSplit ctermfg=244 ctermbg=232 cterm=bold
223 hi VisualNOS ctermbg=238
224 hi Visual ctermbg=235
225 hi WarningMsg ctermfg=231 ctermbg=238 cterm=bold
226 hi WildMenu ctermfg=81 ctermbg=16
227
228 hi Comment ctermfg=59
229 hi CursorColumn ctermbg=236
230 hi ColorColumn ctermbg=236
231 hi LineNr ctermfg=250 ctermbg=236
232 hi NonText ctermfg=59
233
234 hi SpecialKey ctermfg=59
235
236 if exists("g:rehash256") && g:rehash256 == 1
237 hi Normal ctermfg=252 ctermbg=NONE
238 hi CursorLine ctermbg=236 cterm=none
239 hi CursorLineNr ctermfg=208 cterm=none
240
241 hi Boolean ctermfg=141
242 hi Character ctermfg=222
243 hi Number ctermfg=141
244 hi String ctermfg=222
245 hi Conditional ctermfg=197 cterm=bold
246 hi Constant ctermfg=141 cterm=bold
247
248 hi DiffDelete ctermfg=125 ctermbg=233
249
250 hi Directory ctermfg=154 cterm=bold
251 hi Error ctermfg=222 ctermbg=233
252 hi Exception ctermfg=154 cterm=bold
253 hi Float ctermfg=141
254 hi Function ctermfg=154
255 hi Identifier ctermfg=208
256
257 hi Keyword ctermfg=197 cterm=bold
258 hi Operator ctermfg=197
259 hi PreCondit ctermfg=154 cterm=bold
260 hi PreProc ctermfg=154
261 hi Repeat ctermfg=197 cterm=bold
262
263 hi Statement ctermfg=197 cterm=bold
264 hi Tag ctermfg=197
265 hi Title ctermfg=203
266 hi Visual ctermbg=238
267
268 hi Comment ctermfg=244
269 hi LineNr ctermfg=239 ctermbg=235
270 hi NonText ctermfg=239
271 hi SpecialKey ctermfg=239
272 endif
273 end
274
275 " Must be at the end, because of ctermbg=234 bug.
276 " https://groups.google.com/forum/#!msg/vim_dev/afPqwAFNdrU/nqh6tOM87QUJ
277 set background=dark
278
279
280