当前位置: 首页 > news >正文

网站建设待遇头条新闻

网站建设待遇,头条新闻,高端制作网站公司,最新搜索关键词Termux配置Vim C开发环境#xff0c;打造基于终端命令行的IDE 主要利用VimCoc插件#xff0c;配置C的代码提示等功能。 Termux换源 打开termux#xff0c;输入termux-change-repo 找到mirrors.tuna.tsinghua.edu.cn#xff0c;清华源#xff0c;空格选中#xff0c;回…Termux配置Vim C开发环境打造基于终端命令行的IDE 主要利用VimCoc插件配置C的代码提示等功能。 Termux换源 打开termux输入termux-change-repo 找到mirrors.tuna.tsinghua.edu.cn清华源空格选中回车确认 Termux配置ssh 有了ssh后就可以方便的在PC或者其它平台上使用ssh工具远程termux终端了 # 安装 apt install open-ssh # 启动sshd默认端口为8022 sshd # 关闭sshd pkill sshd # 查看sshd是否运行 ps aux | grep sshd默认没有密码使用passwd命令配置密码 ssh user192.168.0.11 -p 8022user用户名可以用whoami命令查看一般termux用户名为u0_xxxx 软件包管理简介 termux使用pkg管理软件包并且可以使用apt别名 例如更新仓库和软件 pkg update apt update pkg upgrade apt upgrade两个命令都可以apt命令对使用过Debian的人非常友好。以下全部使用apt 安装命令就是 apt install xxx安装基础软件 vim编辑器clangC编译器并且提供了g别名cmake管理C项目配置git源码仓库工具nodejsC开发很少用到nodejs主要是为vim插件提供运行环境python3提供环境 apt install vim clang cmake git nodejs python3Vim基础配置 主要配置缩进、tab空格、文件编码、行号等可以根据自己的需求配置 配置项非常少很基础 vim .vimrc编辑.vimrc文件将以下内容输入 vim base config set nocompatible syntax on set showmode set showcmd set encodingutf-8 set t_Co256 filetype indent on set softtabstop4 set tabstop4 set shiftwidth4 set expandtab set autoindent set number set cursorline安装Vim插件 VimPlug用来管理Vim插件之后的插件都需要用它来安装vim-code-darkVsCode主题 VimPlug插件管理 VimPlug主页提供了安装方法 复制下面的命令到终端并执行 curl -fLo ~/.vim/autoload/plug.vim --create-dirs \https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim安装完成后编辑.vimrc文件添加如下代码段 plugin call plug#begin()Plug xxxcall plug#end()中间的Plug xxx就是代表安装xxx插件每个插件一行 每当想安装新的插件时先编辑vimrc再重新进入vim命令模式输入:PlugInstall就会安装插件 卸载插件时编辑vimrc删除插件那一行然后进入vim命令模式输入:PlugClean不在列表里的插件就会被清理 :PlugUpdate更新插件 :PlugUpgrade更新VimPlug本身 VsCode颜色主题 Vim自己的高亮不好看我选择了VsCode主题 Plug tomasiser/vim-code-dark添加上述代码重新打开vim并运行PlugInstall出现Finishing … Done!且插件名称后面显示100%时说明安装成功 再次编辑vimrc添加如下代码 colorscheme codedark再次打开vim时已经变为VsCode主题 Coc代码提示 参考Coc主页安装方式如下 Plug neoclide/coc.nvim, {branch: release}同样运行:PlugInstall就可以安装Coc依赖于NodeJs Coc是类似VimPlug的管理工具具体的语言支持还需要安装语言包 其插件列表可以在CocWiki看到 注意这里的插件指的是Coc插件他们往往都按照coc-xxx命名例如coc-clangd、coc-json等 安装插件需要使用:CocInstall命令例如 CocInstall coc-json coc-tsserverCoc也需要配置配置很多我也没看明白官网给了一个示例主要是配置快捷键补全等功能。 对于C开发环境需要的Coc插件有 coc-clangd提供C语言服务支持coc-cmake提供cmake支持 coc-clangd 安装coc-clangd依赖于clangd在termux中使用apt install clang来安装 :ConInstall coc-clangd安装完成后可以编辑一个cpp文件尝试效果Tab用来选择候选项Enter用来确认 对于多文件项目或者CMake项目插件需要读取compile_commands.json文件这个文件需要在编译时生成。 CMake在构建项目时生成该文件指令为 cmake -S . -B build -DCMAKE_BUILD_TYPEDebug -DCMAKE_EXPORT_COMPILE_COMMANDSTRUE-S指定源代码文件夹-B指定输出目录-DCMAKE_BUILD_TYPE设置构建类型-DCMAKE_EXPORT_COMPILE_COMMANDS指定生成compile_commands.json文件 coc-cmake 依赖cmake lsp pip install cmake-language-server:CocInstall coc-cmake然后就可以使用了 括号补全 使用auto-pairs插件 Plug jiangmiao/auto-pairs无需任何配置 代码格式化 使用vim-clang-format插件参考其主页安装 依赖于clang-format在Termux下安装clang就行 Plug rhysd/vim-clang-format安装完成后可以参考如下代码或者ClangFormat主页配置格式化风格 let g:clang_format#code_styleWebKit格式化命令为:ClangFormat 为了方便把CtrlShifti映射为该命令在常规模式下有效 nnoremap C-S-i :ClangFormatCR缩进参考线 indentLine插件 Plug Yggdroot/indentLine无需配置 最终vimrc源码 vim base config set nocompatible syntax on set showmode set showcmd set encodingutf-8 set t_Co256 filetype indent on set softtabstop4 set tabstop4 set shiftwidth4 set expandtab set autoindent set number set cursorline vim plug call plug#begin()Plug tomasiser/vim-code-dark Plug neoclide/coc.nvim, {branch: release} Plug jiangmiao/auto-pairs Plug rhysd/vim-clang-format Plug Yggdroot/indentLinecall plug#end() vscode theme colorscheme codedarkClang Format let g:clang_format#code_styleWebKit nnoremap C-S-i :ClangFormatCR Coc Config Use tab for trigger completion with characters ahead and navigateNOTE: Theres always complete item selected by default, you may want to enableno select by suggest.noselect: true in your configuration fileNOTE: Use command :verbose imap tab to make sure tab is not mapped byother plugin before putting this into your config inoremap silentexpr TAB\ coc#pum#visible() ? coc#pum#next(1) :\ CheckBackspace() ? \Tab :\ coc#refresh() inoremap exprS-TAB coc#pum#visible() ? coc#pum#prev(1) : \C-h Make CR to accept selected completion item or notify coc.nvim to formatC-gu breaks current undo, please make your own choice inoremap silentexpr CR coc#pum#visible() ? coc#pum#confirm()\: \C-gu\CR\c-rcoc#on_enter()\CRfunction! CheckBackspace() abortlet col col(.) - 1return !col || getline(.)[col - 1] ~# \s endfunction Use c-space to trigger completion if has(nvim)inoremap silentexpr c-space coc#refresh() elseinoremap silentexpr c- coc#refresh() endif Use [g and ]g to navigate diagnosticsUse :CocDiagnostics to get all diagnostics of current buffer in location list nmap silent [g Plug(coc-diagnostic-prev) nmap silent ]g Plug(coc-diagnostic-next) GoTo code navigation nmap silent gd Plug(coc-definition) nmap silent gy Plug(coc-type-definition) nmap silent gi Plug(coc-implementation) nmap silent gr Plug(coc-references) Use K to show documentation in preview window nnoremap silent K :call ShowDocumentation()CRfunction! ShowDocumentation()if CocAction(hasProvider, hover)call CocActionAsync(doHover)elsecall feedkeys(K, in)endif endfunction Highlight the symbol and its references when holding the cursor autocmd CursorHold * silent call CocActionAsync(highlight) Symbol renaming nmap leaderrn Plug(coc-rename) Formatting selected code xmap leaderf Plug(coc-format-selected) nmap leaderf Plug(coc-format-selected)augroup mygroupautocmd! Setup formatexpr specified filetype(s)autocmd FileType typescript,json setl formatexprCocAction(formatSelected) Update signature help on jump placeholderautocmd User CocJumpPlaceholder call CocActionAsync(showSignatureHelp) augroup end Applying code actions to the selected code blockExample: leaderaap for current paragraph xmap leadera Plug(coc-codeaction-selected) nmap leadera Plug(coc-codeaction-selected) Remap keys for applying code actions at the cursor position nmap leaderac Plug(coc-codeaction-cursor)Remap keys for apply code actions affect whole buffer nmap leaderas Plug(coc-codeaction-source)Apply the most preferred quickfix action to fix diagnostic on the current line nmap leaderqf Plug(coc-fix-current) Remap keys for applying refactor code actions nmap silent leaderre Plug(coc-codeaction-refactor) xmap silent leaderr Plug(coc-codeaction-refactor-selected) nmap silent leaderr Plug(coc-codeaction-refactor-selected) Run the Code Lens action on the current line nmap leadercl Plug(coc-codelens-action) Map function and class text objectsNOTE: Requires textDocument.documentSymbol support from the language server xmap if Plug(coc-funcobj-i) omap if Plug(coc-funcobj-i) xmap af Plug(coc-funcobj-a) omap af Plug(coc-funcobj-a) xmap ic Plug(coc-classobj-i) omap ic Plug(coc-classobj-i) xmap ac Plug(coc-classobj-a) omap ac Plug(coc-classobj-a) Remap C-f and C-b to scroll float windows/popups if has(nvim-0.4.0) || has(patch-8.2.0750)nnoremap silentnowaitexpr C-f coc#float#has_scroll() ? coc#float#scroll(1) : \C-fnnoremap silentnowaitexpr C-b coc#float#has_scroll() ? coc#float#scroll(0) : \C-binoremap silentnowaitexpr C-f coc#float#has_scroll() ? \c-rcoc#float#scroll(1)\cr : \Rightinoremap silentnowaitexpr C-b coc#float#has_scroll() ? \c-rcoc#float#scroll(0)\cr : \Leftvnoremap silentnowaitexpr C-f coc#float#has_scroll() ? coc#float#scroll(1) : \C-fvnoremap silentnowaitexpr C-b coc#float#has_scroll() ? coc#float#scroll(0) : \C-b endif Use CTRL-S for selections rangesRequires textDocument/selectionRange support of language server nmap silent C-s Plug(coc-range-select) xmap silent C-s Plug(coc-range-select) Add :Format command to format current buffer command! -nargs0 Format :call CocActionAsync(format) Add :Fold command to fold current buffer command! -nargs? Fold :call CocAction(fold, f-args) Add :OR command for organize imports of the current buffer command! -nargs0 OR :call CocActionAsync(runCommand, editor.action.organizeImport) Add (Neo)Vims native statusline supportNOTE: Please see :h coc-status for integrations with external plugins thatprovide custom statusline: lightline.vim, vim-airline set statusline^%{coc#status()}%{get(b:,coc_current_function,)} Mappings for CoCListShow all diagnostics nnoremap silentnowait spacea :C-uCocList diagnosticscrManage extensions nnoremap silentnowait spacee :C-uCocList extensionscrShow commands nnoremap silentnowait spacec :C-uCocList commandscrFind symbol of current document nnoremap silentnowait spaceo :C-uCocList outlinecrSearch workspace symbols nnoremap silentnowait spaces :C-uCocList -I symbolscrDo default action for next item nnoremap silentnowait spacej :C-uCocNextCRDo default action for previous item nnoremap silentnowait spacek :C-uCocPrevCRResume latest coc list nnoremap silentnowait spacep :C-uCocListResumeCR
http://www.hkea.cn/news/14388161/

相关文章:

  • 定远县建设小学网站建筑工程类招聘网站
  • 贵港网站建设动态腾讯企点官网入口
  • 哪个公司做视频网站怎么创办自己的网站
  • wordpress编辑网站门户类型网站有哪些
  • 自己不会代码让别人做网站怎么管理网站建设123
  • 东圃网站建设flash个人网站欣赏
  • 红色网站 推荐淮安网站建设设计制作
  • 银川市建设工程质量监督站网站东莞网站建设 乐云seo
  • wordpress提交订单青岛seo建站
  • 紫金网站制作国外营销型网站
  • c 网站开发实战网络技术培训心得体会
  • 网站怎么做高权重asp网站耗资源
  • 做装修的业务网站网站支付接口如何做
  • 做离线版申报表进入哪个网站wordpress首页没有ssl
  • 可以做初中地理题的网站wordpress媒体库上限
  • flash手机网站制作淮南网络推广公司
  • 网站怎么做qq微信登陆界面设计腾讯云网站搭建教程
  • 网站建设需要懂什么语言免费微网站模板
  • 做非法网站判什么邢wordpress前端是什么意思
  • 外贸网站建设seo优化顺企网杭州网站建设
  • seo做的好的网站网站规划主要内容
  • 单页网站域名耐克网站建设策划方案
  • 企业网站备案怎么做软文范例100字
  • 万网建设网站百度关键词排名代做
  • 游戏网站建设多少钱微信 网站
  • a站为什么会凉手机app界面设计图
  • 网站欢迎页面 特效湖南省住房城乡建设网站
  • 全面的网站制作seo实战
  • 公司网站开发有哪些前端开发规范
  • 手机网站适合分开做学校做的网站外面访问不了