mac vim F1~F12快捷键映射无效问题

这篇博客介绍了如何解决在macVim中F1到F12快捷键映射无效的问题。通过在vim偏好设置中将终端类型设置为xterm-256color,并提供了一段bash配置,包括颜色方案、自动换行、搜索设置、语法高亮等。同时,还展示了如何使用cscope进行代码搜索,并定义了F2到F12的功能快捷键,以及如何实现粘贴板与vim之间的复制粘贴功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在vim的偏好设置----描述文件----高级----Terminfo-----声明终端为xterm-256color


另外附上bash设置

set nocompatible
colorscheme solarized
set t_Co=256
let g:solarized_termcolors=256
set number
set statusline=2
set shiftwidth=4 " 设定 << 和 >> 命令移动时的宽度为 4
set softtabstop=4 " 使得按退格键时可以一次删掉 4 个空格
set expandtab
set tabstop=4 " 设定 tab 长度为 4
set nobackup " 覆盖文件时不备份
set autochdir " 自动切换当前目录为当前文件所在的目录
filetype plugin indent on " 开启插件
set backupcopy=yes " 设置备份时的行为为覆盖
set ignorecase smartcase " 搜索时忽略大小写,但在有一个或以上大写字母时仍保持对大小写敏感
set nowrapscan " 禁止在搜索到文件两端时重新搜索
set incsearch " 输入搜索内容时就显示搜索结果
set hlsearch " 搜索时高亮显示被找到的文本
set noerrorbells " 关闭错误信息响铃
set novisualbell " 关闭使用可视响铃代替呼叫
set t_vb= " 置空错误铃声的终端代码
syntax on " 自动语法高亮
hi Normal ctermbg=NONE ctermfg=white  


set cscopequickfix=s-,c-,d-,i-,t-,e-


if has("cscope")
    set csprg=/Users/moon/bin/cscope.sh
    set csto=0
    set cst
    set nocsverb
    if filereadable("cscope.out")
        cs add cscope.out
    elseif $CSCOPE_DB != ""
        cs add $CSCOPE_DB
    endif
    set csverb
endif


map <F2> :cs find 
map <F3> :cw<CR>
map <F4> :cclose<CR>
map <F5> :TlistToggle<CR>


nmap <C-c>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-c>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-c>c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-c>t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-c>e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-c>f :cs find f <C-R>=expand("<cword>")<CR><CR>
nmap <C-c>i :cs find i ^<C-R>=expand("<cword>")<CR>$<CR>
nmap <C-c>d :cs find d <C-R>=expand("<cword>")<CR><CR>
nmap <C-n> :cn<CR>
nmap <C-p> :cp<CR>


vmap "+y :w !pbcopy<CR><CR> 
nmap "+p :r !pbpaste<CR><CR>


let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值