配置 gvim 设置颜色和字体

2023-12-04

我想尝试一下 vim,但是配置文件有点问题。我这里已经安装了gvimC:\Program Files (x86)\Vim\vim73并添加了一个名为C:\Program Files (x86)\Vim\vim73\.vimrc,但是当我尝试不同的配置时,它似乎没有改变任何东西。

例如我尝试过这个

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Maintainer: amix the lucky stiff
"             http://amix.dk - [email protected]
"
" Version: 3.6 - 25/08/10 14:40:30
"
" Blog_post: 
"       http://amix.dk/blog/post/19486#The-ultimate-vim-configuration-vimrc
" Syntax_highlighted:
"       http://amix.dk/vim/vimrc.html
" Raw_version: 
"       http://amix.dk/vim/vimrc.txt
"
" How_to_Install_on_Unix:
"    $ mkdir ~/.vim_runtime
"    $ svn co svn://orangoo.com/vim ~/.vim_runtime
"    $ cat ~/.vim_runtime/install.sh
"    $ sh ~/.vim_runtime/install.sh <system>
"      <sytem> can be `mac`, `linux` or `windows`
"
" How_to_Upgrade:
"    $ svn update ~/.vim_runtime
"
" Sections:
"    -> General
"    -> VIM user interface
"    -> Colors and Fonts
"    -> Files and backups
"    -> Text, tab and indent related
"    -> Visual mode related
"    -> Command mode related
"    -> Moving around, tabs and buffers
"    -> Statusline
"    -> Parenthesis/bracket expanding
"    -> General Abbrevs
"    -> Editing mappings
"
"    -> Cope
"    -> Minibuffer plugin
"    -> Omni complete functions
"    -> Python section
"    -> JavaScript section
"
"
" Plugins_Included:
"     > minibufexpl.vim - http://www.vim.org/scripts/script.php?script_id=159
"       Makes it easy to get an overview of buffers:
"           info -> :e ~/.vim_runtime/plugin/minibufexpl.vim
"
"     > bufexplorer - http://www.vim.org/scripts/script.php?script_id=42
"       Makes it easy to switch between buffers:
"           info -> :help bufExplorer
"
"     > yankring.vim - http://www.vim.org/scripts/script.php?script_id=1234
"       Emacs's killring, useful when using the clipboard:
"           info -> :help yankring
"
"     > surround.vim - http://www.vim.org/scripts/script.php?script_id=1697
"       Makes it easy to work with surrounding text:
"           info -> :help surround
"
"     > snipMate.vim - http://www.vim.org/scripts/script.php?script_id=2540
"       Snippets for many languages (similar to TextMate's):
"           info -> :help snipMate
"
"     > mru.vim - http://www.vim.org/scripts/script.php?script_id=521
"       Plugin to manage Most Recently Used (MRU) files:
"           info -> :e ~/.vim_runtime/plugin/mru.vim
"
"     > Command-T - http://www.vim.org/scripts/script.php?script_id=3025
"       Command-T plug-in provides an extremely fast, intuitive mechanism for opening filesa:
"           info -> :help CommandT
"           screencast and web-help -> http://amix.dk/blog/post/19501
"
"
"  Revisions:
"     > 3.6: Added lots of stuff (colors, Command-T, Vim 7.3 persistent undo etc.)
"     > 3.5: Paste mode is now shown in status line  if you are in paste mode
"     > 3.4: Added mru.vim
"     > 3.3: Added syntax highlighting for Mako mako.vim 
"     > 3.2: Turned on python_highlight_all for better syntax
"            highlighting for Python
"     > 3.1: Added revisions ;) and bufexplorer.vim
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Sets how many lines of history VIM has to remember
set history=700

" Enable filetype plugin
filetype plugin on
filetype indent on

" Set to auto read when a file is changed from the outside
set autoread

" With a map leader it's possible to do extra key combinations
" like <leader>w saves the current file
let mapleader = ","
let g:mapleader = ","

" Fast saving
nmap <leader>w :w!<cr>

" Fast editing of the .vimrc
map <leader>e :e! ~/.vim_runtime/vimrc<cr>

" When vimrc is edited, reload it
autocmd! bufwritepost vimrc source ~/.vim_runtime/vimrc


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => VIM user interface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Set 7 lines to the curors - when moving vertical..
set so=7

set wildmenu "Turn on WiLd menu

set ruler "Always show current position

set cmdheight=2 "The commandbar height

set hid "Change buffer - without saving

" Set backspace config
set backspace=eol,start,indent
set whichwrap+=<,>,h,l

set ignorecase "Ignore case when searching
set smartcase

set hlsearch "Highlight search things

set incsearch "Make search act like search in modern browsers
set nolazyredraw "Don't redraw while executing macros 

set magic "Set magic on, for regular expressions

set showmatch "Show matching bracets when text indicator is over them
set mat=2 "How many tenths of a second to blink

" No sound on errors
set noerrorbells
set novisualbell
set t_vb=
set tm=500


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Colors and Fonts
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
syntax enable "Enable syntax hl

" Set font according to system
if MySys() == "mac"
  set gfn=Menlo:h14
  set shell=/bin/bash
elseif MySys() == "windows"
  set gfn=Bitstream\ Vera\ Sans\ Mono:h10
elseif MySys() == "linux"
  set gfn=Monospace\ 10
  set shell=/bin/bash
endif

if has("gui_running")
  set guioptions-=T
  set t_Co=256
  set background=dark
  colorscheme peaksea
  set nonu
else
  colorscheme zellner
  set background=dark

  set nonu
endif

set encoding=utf8
try
    lang en_US
catch
endtry

set ffs=unix,dos,mac "Default file types


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Files, backups and undo
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Turn backup off, since most stuff is in SVN, git anyway...
set nobackup
set nowb
set noswapfile

"Persistent undo
try
    if MySys() == "windows"
      set undodir=C:\Windows\Temp
    else
      set undodir=~/.vim_runtime/undodir
    endif

    set undofile
catch
endtry


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Text, tab and indent related
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set expandtab
set shiftwidth=4
set tabstop=4
set smarttab

set lbr
set tw=500

set ai "Auto indent
set si "Smart indet
set wrap "Wrap lines


""""""""""""""""""""""""""""""
" => Visual mode related
""""""""""""""""""""""""""""""
" Really useful!
"  In visual mode when you press * or # to search for the current selection
vnoremap <silent> * :call VisualSearch('f')<CR>
vnoremap <silent> # :call VisualSearch('b')<CR>

" When you press gv you vimgrep after the selected text
vnoremap <silent> gv :call VisualSearch('gv')<CR>
map <leader>g :vimgrep // **/*.<left><left><left><left><left><left><left>


function! CmdLine(str)
    exe "menu Foo.Bar :" . a:str
    emenu Foo.Bar
    unmenu Foo
endfunction 

" From an idea by Michael Naumann
function! VisualSearch(direction) range
    let l:saved_reg = @"
    execute "normal! vgvy"

    let l:pattern = escape(@", '\\/.*$^~[]')
    let l:pattern = substitute(l:pattern, "\n$", "", "")

    if a:direction == 'b'
        execute "normal ?" . l:pattern . "^M"
    elseif a:direction == 'gv'
        call CmdLine("vimgrep " . '/'. l:pattern . '/' . ' **/*.')
    elseif a:direction == 'f'
        execute "normal /" . l:pattern . "^M"
    endif

    let @/ = l:pattern
    let @" = l:saved_reg
endfunction



"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Command mode related
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Smart mappings on the command line
cno $h e ~/
cno $d e ~/Desktop/
cno $j e ./
cno $c e <C-\>eCurrentFileDir("e")<cr>

" $q is super useful when browsing on the command line
cno $q <C-\>eDeleteTillSlash()<cr>

" Bash like keys for the command line
cnoremap <C-A>      <Home>
cnoremap <C-E>      <End>
cnoremap <C-K>      <C-U>

cnoremap <C-P> <Up>
cnoremap <C-N> <Down>

" Useful on some European keyboards
map ½ $
imap ½ $
vmap ½ $
cmap ½ $


func! Cwd()
  let cwd = getcwd()
  return "e " . cwd 
endfunc

func! DeleteTillSlash()
  let g:cmd = getcmdline()
  if MySys() == "linux" || MySys() == "mac"
    let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*", "\\1", "")
  else
    let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\]\\).*", "\\1", "")
  endif
  if g:cmd == g:cmd_edited
    if MySys() == "linux" || MySys() == "mac"
      let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*/", "\\1", "")
    else
      let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\\]\\).*\[\\\\\]", "\\1", "")
    endif
  endif   
  return g:cmd_edited
endfunc

func! CurrentFileDir(cmd)
  return a:cmd . " " . expand("%:p:h") . "/"
endfunc


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Moving around, tabs and buffers
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Map space to / (search) and c-space to ? (backgwards search)
map <space> /
map <c-space> ?
map <silent> <leader><cr> :noh<cr>

" Smart way to move btw. windows
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l

" Close the current buffer
map <leader>bd :Bclose<cr>

" Close all the buffers
map <leader>ba :1,300 bd!<cr>

" Use the arrows to something usefull
map <right> :bn<cr>
map <left> :bp<cr>

" Tab configuration
map <leader>tn :tabnew<cr>
map <leader>te :tabedit 
map <leader>tc :tabclose<cr>
map <leader>tm :tabmove 

" When pressing <leader>cd switch to the directory of the open buffer
map <leader>cd :cd %:p:h<cr>


command! Bclose call <SID>BufcloseCloseIt()
function! <SID>BufcloseCloseIt()
   let l:currentBufNum = bufnr("%")
   let l:alternateBufNum = bufnr("#")

   if buflisted(l:alternateBufNum)
     buffer #
   else
     bnext
   endif

   if bufnr("%") == l:currentBufNum
     new
   endif

   if buflisted(l:currentBufNum)
     execute("bdelete! ".l:currentBufNum)
   endif
endfunction

" Specify the behavior when switching between buffers 
try
  set switchbuf=usetab
  set stal=2
catch
endtry


""""""""""""""""""""""""""""""
" => Statusline
""""""""""""""""""""""""""""""
" Always hide the statusline
set laststatus=2

" Format the statusline
set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{CurDir()}%h\ \ \ Line:\ %l/%L:%c


function! CurDir()
    let curdir = substitute(getcwd(), '/Users/amir/', "~/", "g")
    return curdir
endfunction

function! HasPaste()
    if &paste
        return 'PASTE MODE  '
    else
        return ''
    endif
endfunction


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Parenthesis/bracket expanding
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
vnoremap $1 <esc>`>a)<esc>`<i(<esc>
vnoremap $2 <esc>`>a]<esc>`<i[<esc>
vnoremap $3 <esc>`>a}<esc>`<i{<esc>
vnoremap $$ <esc>`>a"<esc>`<i"<esc>
vnoremap $q <esc>`>a'<esc>`<i'<esc>
vnoremap $e <esc>`>a"<esc>`<i"<esc>

" Map auto complete of (, ", ', [
inoremap $1 ()<esc>i
inoremap $2 []<esc>i
inoremap $3 {}<esc>i
inoremap $4 {<esc>o}<esc>O
inoremap $q ''<esc>i
inoremap $e ""<esc>i
inoremap $t <><esc>i


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General Abbrevs
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
iab xdate <c-r>=strftime("%d/%m/%y %H:%M:%S")<cr>


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Editing mappings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Remap VIM 0
map 0 ^

"Move a line of text using ALT+[jk] or Comamnd+[jk] on mac
nmap <M-j> mz:m+<cr>`z
nmap <M-k> mz:m-2<cr>`z
vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z
vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z

if MySys() == "mac"
  nmap <D-j> <M-j>
  nmap <D-k> <M-k>
  vmap <D-j> <M-j>
  vmap <D-k> <M-k>
endif

"Delete trailing white space, useful for Python ;)
func! DeleteTrailingWS()
  exe "normal mz"
  %s/\s\+$//ge
  exe "normal `z"
endfunc
autocmd BufWrite *.py :call DeleteTrailingWS()

set guitablabel=%t


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Cope
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Do :help cope if you are unsure what cope is. It's super useful!
map <leader>cc :botright cope<cr>
map <leader>n :cn<cr>
map <leader>p :cp<cr>


""""""""""""""""""""""""""""""
" => bufExplorer plugin
""""""""""""""""""""""""""""""
let g:bufExplorerDefaultHelp=0
let g:bufExplorerShowRelativePath=1
map <leader>o :BufExplorer<cr>


""""""""""""""""""""""""""""""
" => Minibuffer plugin
""""""""""""""""""""""""""""""
let g:miniBufExplModSelTarget = 1
let g:miniBufExplorerMoreThanOne = 2
let g:miniBufExplModSelTarget = 0
let g:miniBufExplUseSingleClick = 1
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplVSplit = 25
let g:miniBufExplSplitBelow=1

let g:bufExplorerSortBy = "name"

autocmd BufRead,BufNew :call UMiniBufExplorer

map <leader>u :TMiniBufExplorer<cr>


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Omni complete functions
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
autocmd FileType css set omnifunc=csscomplete#CompleteCSS


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Spell checking
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Pressing ,ss will toggle and untoggle spell checking
map <leader>ss :setlocal spell!<cr>

"Shortcuts using <leader>
map <leader>sn ]s
map <leader>sp [s
map <leader>sa zg
map <leader>s? z=


""""""""""""""""""""""""""""""
" => Python section
""""""""""""""""""""""""""""""
let python_highlight_all = 1
au FileType python syn keyword pythonDecorator True None False self

au BufNewFile,BufRead *.jinja set syntax=htmljinja
au BufNewFile,BufRead *.mako set ft=mako

au FileType python inoremap <buffer> $r return 
au FileType python inoremap <buffer> $i import 
au FileType python inoremap <buffer> $p print 
au FileType python inoremap <buffer> $f #--- PH ----------------------------------------------<esc>FP2xi
au FileType python map <buffer> <leader>1 /class 
au FileType python map <buffer> <leader>2 /def 
au FileType python map <buffer> <leader>C ?class 
au FileType python map <buffer> <leader>D ?def 


""""""""""""""""""""""""""""""
" => JavaScript section
"""""""""""""""""""""""""""""""
au FileType javascript call JavaScriptFold()
au FileType javascript setl fen
au FileType javascript setl nocindent

au FileType javascript imap <c-t> AJS.log();<esc>hi
au FileType javascript imap <c-a> alert();<esc>hi

au FileType javascript inoremap <buffer> $r return 
au FileType javascript inoremap <buffer> $f //--- PH ----------------------------------------------<esc>FP2xi

function! JavaScriptFold() 
    setl foldmethod=syntax
    setl foldlevelstart=1
    syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend

    function! FoldText()
    return substitute(getline(v:foldstart), '{.*', '{...}', '')
    endfunction
    setl foldtext=FoldText()
endfunction


""""""""""""""""""""""""""""""
" => MRU plugin
""""""""""""""""""""""""""""""
let MRU_Max_Entries = 400
map <leader>f :MRU<CR>


""""""""""""""""""""""""""""""
" => Command-T
""""""""""""""""""""""""""""""
let g:CommandTMaxHeight = 15
set wildignore+=*.o,*.obj,.git,*.pyc
noremap <leader>j :CommandT<cr>
noremap <leader>y :CommandTFlush<cr>


""""""""""""""""""""""""""""""
" => Vim grep
""""""""""""""""""""""""""""""
let Grep_Skip_Dirs = 'RCS CVS SCCS .svn generated'
set grepprg=/bin/grep\ -nH



"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => MISC
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Remove the Windows ^M - when the encodings gets messed up
noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm

"Quickly open a buffer for scripbble
map <leader>q :e ~/buffer<cr>
au BufRead,BufNewFile ~/buffer iab <buffer> xh1 ===========================================

map <leader>pp :setlocal paste!<cr>

map <leader>bb :cd ..<cr>

根据我的理解,这应该从默认颜色更改为peaksea,但这不起作用...

if has("gui_running")
  set guioptions-=T
  set t_Co=256
  set background=dark
  colorscheme peaksea
  set nonu
else
  colorscheme zellner
  set background=dark

  set nonu
endif

to

I have peaksea安装并工作,但我希望它作为默认启动。我还想默认使用除固定系统之外的另一种字体(谁决定将其作为默认字体?!)


将以下行放入您的.vimrc or .gvimrc(GVIM) 文件。

set colorscheme peaksea

如果该文件不存在,您可以先通过以下方式创建它

touch ~/.vimrc
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

配置 gvim 设置颜色和字体 的相关文章

  • 在 Vim 中,为什么用 'j' 表示向下,用 'k' 表示向上?

    我使用 Vim 已经很多年了 但从未真正考虑过它 我的一个朋友问这是为什么 他指出在我们的文化中 左键通常映射到上 而右键映射到下 使 Vim 键向后 我知道它们位于主排 这意味着您不必将手指移动到任何地方即可击中它们 但这完全是不同的点
  • 带有用户信息的 Django Logger

    我只是好奇 是否可以放User内的信息formatters信息输入LOGGING配置在setting py 现在我只是将该信息放入要记录的消息中 但也许有一种方法可以将其设置为formatters争论 这是我的LOGGING现在的配置 LO
  • 如何在 Windows 上的 Eclipse 中设置 Clang 工具链?

    我为一个愚蠢的问题道歉 但我在网上找不到答案 我正在努力为 64 位计算机上的 Windows 7 中的 Eclipse 设置 Clang 编译器 链接器 我对 C 的了解非常过时 并且从未在 Eclipse 中工作过 我想要实现的是在 W
  • vim 中的正则表达式查找和替换:向数字添加 .0

    我有一个如下所示的文件 1 1 0 1 6 1 0 2 8 1 0 3 10 1 0 4 12 1 0 6 如何为所有数字添加 0 后面的数字除外 我认为用正则表达式来做到这一点应该不会太难 但是我的正则表达式知识太生疏了 使用 VIM s
  • 开发人员实际上是否使用 vim 在 Windows 操作系统上编写代码(Java)? [关闭]

    就目前情况而言 这个问题不太适合我们的问答形式 我们希望答案得到事实 参考资料或专业知识的支持 但这个问题可能会引发辩论 争论 民意调查或扩展讨论 如果您觉得这个问题可以改进并可能重新开放 访问帮助中心 help reopen questi
  • 如何在dll级别读取app.config? [复制]

    这个问题在这里已经有答案了 我在一个解决方案中有一个控制台应用程序项目和库项目 dll The 图书馆项目有 app config 文件 我在其中存储我在库中使用的一些键值对 控制台应用程序引用此 dll 我有另一个 app config
  • ModX Revo:更新站点基本 URL?

    在选择域名之前 我为客户开发了一个网站 因此 网站页面的 URL 如下所示 http host mynost net tempname index php id 8 域名现已购买 但如果我单击任何 Wayfinder 链接 它仍然使用上面的
  • 允许出口流量流向单个 IP 地址

    我正在编写 Kubernetes 集群的网络策略 如何在出口策略中指定要授权的单个 IP 地址 而不是授权整个 IP 地址范围 一个基于的例子官方文档 https kubernetes io docs concepts services n
  • MacVim:跨窗口共享命名寄存器?

    我想跨 MacVim 窗口共享命名寄存器缓冲区 就像我在单个实例中跨缓冲区一样 换句话说 假设我标记了一个位置 m 然后去其他地方 我将一些文本拉入寄存器 a 从当前点到 m a m 然后我转到另一个窗口 不 我不是指同一窗口中的另一个分割
  • R 控制台是我的母语,如何将 R 设置为英语?

    我在 Windows 7 上使用 R 显然 R 不知何故发现了我说英语以外的语言的证据 并且顽固地坚持在控制台中以我自己的语言提供输出 由于多种原因 这是不可取的 我希望 R 是英语 什么有效 我能够使用LANGUAGE en作为 R 控制
  • 在 iOS 上保存(私人)应用程序设置?

    我知道NSUserDefaults用于保存 恢复user优先 什么是等效类应用 例如 应用程序可能有一个 上次运行 字段 或者它可能有一个用于在应用程序级别使用的设备的唯一标识的字段 我的目的是将应用程序的设置 而不是用户的设置 保留在设置
  • 如何设置打开文件时默认展开?

    In my vimrc我已经把set foldmethod syntax启用方法折叠等 但是 我不喜欢每次打开文件时都会折叠整个文件的默认设置 有没有办法启用foldmethod 但是当我打开文件时文件是否展开了 set foldlevel
  • 不将所需的文件包含到 vim 全方位补全中

    如果我尝试在具有 require xxx 语句的 Ruby 文件中自动完成 它会开始扫描所需的所有文件 以及所需文件所需的文件 它每次都会这样做 是否可以使 vim 自动完成功能不扫描所需文件或仅扫描特定路径中的文件 例如仅 app 以下之
  • 在 Archlinux 上使用 Vim 作为 Haskell 的 IDE 目前情况如何?

    如果可行的话 我的目标是通过 YouCompleteMe 在 Vim 中完成 Haskell 的命令 在这方面 正如您在下面看到的 我还没有找到关于如何让它发挥作用的共识 相关评论的最新评论YouCompleteMe 上的问题 https
  • Docker、maven 和 settings.xml

    给出以下简单的 Dockerfile FROM maven 3 6 3 ibmjava 8 alpine Copy maven settings COPY settings xml usr share maven ref COPY pom
  • Web.config appSettings:复杂值

    Web config 的 appSettings 部分只能存储这样的简单字符串吗
  • 使用环境变量在 redis.conf 中设置动态路径

    我有一个环境变量MY HOME其中有一个目录的路径 home abc 现在 我有一个redis conf文件 我需要像这样设置这个路径 redis conf pidfile MY HOME local var pids redis pid
  • 在 vim 中执行 python 命令并获取输出

    当 Vim 编译时支持 Python 时 您可以使用 Python 编写 Vim 脚本 python命令 我将如何使用它来执行命令并将结果插入光标下 例如 如果我要执行 python import os os listdir aDirect
  • 设置 vim 命令的键盘快捷键

    说我想要
  • 使用 .NET C# 从 Azure 云服务读取配置设置

    我正在寻找一种使用 C 从部署的 Windows Azure 云服务读取设置的方法 是否有任何 Azure SDK 可用于轻松加载此值 Azure 门户的屏幕截图显示了我要读取的设置 EDIT1 我错过了补充一点 我尝试从外部应用程序加载设

随机推荐

  • 当我最大化 JInternalFrame 时 JInternalFrame 上的示例程序 JMenubar

    Hi I need an Example program in which When i maximize the JInternalFrame the JMenuBar of JFrame should set on JInternalF
  • iPad应用程序可以直接启动另一个应用程序吗?

    我想知道是否可以直接从另一个应用程序中启动 iPad 应用程序 例如 我可以编写一个登录页面 该页面也会带您进入桌面类型页面 您可以在其中选择要运行的应用程序 然后以新线程的方式启动该应用程序 我不确定这是否可行 我只是对新的 iOS 多任
  • 我怎样才能访问放置在 WEB-INF 文件夹中的文件

    我是java新手 有一个奇怪的问题 我在 WEB INF 文件夹中创建一些文件夹 主题 js css 并将我的文件放入此文件夹中 在index jsp中我通过以下方式使用css文件 效果很好 但在 style css 文件中 我有一个 di
  • 如何在Javascript中获取`background-color`属性值? [复制]

    这个问题在这里已经有答案了 fiddle 以下代码警告空字符串 HTML div test div CSS test background color f00 SCRIPT alert document getElementById tes
  • 验证 Assertj 中是否已调用断言

    我正在阅读使用 Assertj 来验证结果的测试类 有时 我会发现一个没有断言的assertThat assertThat object getField 是否有可能在开发周期的某个地方识别这些类 我的第一个猜测是使用自定义声纳规则 尽管我
  • 无法使用 Mac x86 程序集将 .data 中的变量移动到寄存器

    我用 AT T 语法编写了一小段程序集 目前已在 data部分 但是 当我尝试将这些变量中的任何一个移动到寄存器时 例如 eax 一个错误来自gcc被提出 代码和错误信息如下 data x int 14 y int 4 str string
  • Java静态序列化规则?

    我正在使用一些静态方法和字段进行保存状态序列化 我可以发誓尽管序列化和静态造成了混乱 我应该让所有静态都是瞬态的吗 增加通话量会恢复正常吗 statics 是隐含的transient 所以你不需要这样声明它们 序列化是为了序列化实例 not
  • x86_64 程序集 - 尝试在 x64 程序集中编辑数组内的字节时出现段错误

    我遵循的教程适用于 x86 是使用 32 位汇编编写的 我尝试在学习 x64 汇编的过程中遵循该教程 直到本课为止 一切都进展顺利 我有以下简单的程序 它只是尝试修改字符串中的单个字符 它编译得很好 但运行时出现段错误 section te
  • 使用 firebase 进行 JUnit 类测试

    我试图JUnit测试这个类 public class WeekListActivity extends AppCompatActivity implements AdapterView OnItemClickListener private
  • 如何解决此错误“webelement 不支持索引”[webdriver][python]

    我正在进行 xpath 搜索 page driver find element by xpath td class mceIframeContainer mceFirst mceLast 1 这给了我在 firebug 中所需的第一类项目
  • Google Map API V3:MarkerClusterer 不会分解为标记

    我有一个应用程序 我使用 Google Map API 来显示用户使用其纬度 经度发布的帖子的标记 我使用了 MarkerClusterer 功能来更好地组织标记 该功能可以工作 但存在一些错误 本质上 我一直在家里对此进行测试 因此所有测
  • 我对 Sails.js 水线一对一关联逻辑感到困惑

    所以我感到困惑的原因是因为我是一名 PHP 开发人员并且经常使用 Laravel 和 FuelPHP 我真正不明白的是协会本身 我的意思是 我想创建一个基本的 hasOne BelongsTo 逻辑 其中包含以下内容 用户只有一份个人资料
  • 在 Scala 中计算最多 5 的中位数

    因此 在回答其他一些问题时 我偶然发现计算 5 的中位数的必要性 现在 有一个类似的问题用另一种语言 但我想要一个 Scala 算法 但我不确定我对我的算法是否满意 这是一个不可变的 Scala 版本 它具有最少的比较次数 6 并且看起来不
  • 由于 reticulate_python 导致闪亮应用程序部署出现问题

    我有一个应用程序想要部署在shinyapps io 上 我认为值得注意的是 应用程序中的数据是从 athena 的数据库中提取的 我用了这个包Rathena连接到数据库以及所有用于从我的计算机本地运行良好的内容 但是 我尝试将其部署到shi
  • 如何正确隐藏这些广告横幅?

    Sprite Kit 游戏 我希望在游戏过程中隐藏我的广告横幅 我已经将我的项目设置为包含 iAd 和 AdMob 广告横幅 在添加 AdMob SDK 和 AdMob 广告代码之前 当我想要隐藏 iAd 横幅时 隐藏它没有任何问题 现在由
  • 具有导出选项(如数据表)的等效单个 Html 文件

    我使用 DataTables 使用静态数据创建了一个 HTML 表 带有导出选项 搜索 分页 plnkr co edit n3cbx8GrGoJtOpgbxE32 p preview 类似的示例或工作 html 可在 angular ui
  • 登录对话框 PyQt

    当客户询问我是否可以在应用程序启动时实现某种登录表单时 我几乎完成了我的应用程序 到目前为止 我已经设计了用户界面 并修改了实际的执行 用户名和密码目前无关紧要 class Login QtGui QDialog def init self
  • 我无法使用 ctypes 访问 C++ 类属性

    我正在使用 ctypes 为 C 库开发一种 Python API 到目前为止 一切都很顺利 但是 我将操作系统从 Ubuntu 20 4 LTS 升级到 22 04 现在使用 Python3 10 6 和 g 11 3 0 但即使使用 g
  • 将基于Box的树结构适配为Rc+RefCell时如何处理“临时值丢失”错误?

    我创建了一个树 其类型定义类似于 derive Debug Clone pub crate struct TreeBox
  • 配置 gvim 设置颜色和字体

    我想尝试一下 vim 但是配置文件有点问题 我这里已经安装了gvimC Program Files x86 Vim vim73并添加了一个名为C Program Files x86 Vim vim73 vimrc 但是当我尝试不同的配置时