首页 > 其他分享 >分享我的Nvim Go语言配置文件

分享我的Nvim Go语言配置文件

时间:2024-10-13 12:00:05浏览次数:1  
标签:markdown 配置文件 default set let Go mkdp preview Nvim

细节参考我的另一篇文章(C++那篇)

需要配置好Go语言的环境变量(可参考https://learnku.com/articles/24924

call plug#begin('~/.config/nvim/plugged')

Plug 'preservim/nerdtree'
Plug 'majutsushi/tagbar'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'joshdick/onedark.vim'

call plug#end()

colo onedark
set nu
set softtabstop=4
set tabstop=4
set shiftwidth=4
set cindent
" Exit Vim if NERDTree is the only window remaining in the only tab.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
" Start NERDTree when Vim starts with a directory argument.
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists('s:std_in') |
    \ execute 'NERDTree' argv()[0] | wincmd p | enew | execute 'cd '.argv()[0] | endif

" Set internal encoding of vim, not needed on neovim, since coc.nvim using some
" unicode characters in the file autoload/float.vim
set encoding=utf-8

nmap <Space> :TagbarToggle<CR>

" set to 1, nvim will open the preview window after entering the markdown buffer
" default: 0
let g:mkdp_auto_start = 0

" set to 1, the nvim will auto close current preview window when change
" from markdown buffer to another buffer
" default: 1
let g:mkdp_auto_close = 1

" set to 1, the vim will refresh markdown when save the buffer or
" leave from insert mode, default 0 is auto refresh markdown as you edit or
" move the cursor
" default: 0
let g:mkdp_refresh_slow = 0

" set to 1, the MarkdownPreview command can be use for all files,
" by default it can be use in markdown file
" default: 0
let g:mkdp_command_for_global = 0

" set to 1, preview server available to others in your network
" by default, the server listens on localhost (127.0.0.1)
" default: 0
let g:mkdp_open_to_the_world = 0

" use custom IP to open preview page
" useful when you work in remote vim and preview on local browser
" more detail see: https://github.com/iamcco/markdown-preview.nvim/pull/9
" default empty
let g:mkdp_open_ip = ''

" specify browser to open preview page
" for path with space
" valid: `/path/with\ space/xxx`
" invalid: `/path/with\\ space/xxx`
" default: ''
let g:mkdp_browser = ''

" set to 1, echo preview page url in command line when open preview page
" default is 0
let g:mkdp_echo_preview_url = 0

" a custom vim function name to open preview page
" this function will receive url as param
" default is empty
let g:mkdp_browserfunc = ''

" options for markdown render
" mkit: markdown-it options for render
" katex: katex options for math
" uml: markdown-it-plantuml options
" maid: mermaid options
" disable_sync_scroll: if disable sync scroll, default 0
" sync_scroll_type: 'middle', 'top' or 'relative', default value is 'middle'
"   middle: mean the cursor position alway show at the middle of the preview page
"   top: mean the vim top viewport alway show at the top of the preview page
"   relative: mean the cursor position alway show at the relative positon of the preview page
" hide_yaml_meta: if hide yaml metadata, default is 1
" sequence_diagrams: js-sequence-diagrams options
" content_editable: if enable content editable for preview page, default: v:false
" disable_filename: if disable filename header for preview page, default: 0
let g:mkdp_preview_options = {
    \ 'mkit': {},
    \ 'katex': {},
    \ 'uml': {},
    \ 'maid': {},
    \ 'disable_sync_scroll': 0,
    \ 'sync_scroll_type': 'middle',
    \ 'hide_yaml_meta': 1,
    \ 'sequence_diagrams': {},
    \ 'flowchart_diagrams': {},
    \ 'content_editable': v:false,
    \ 'disable_filename': 0,
    \ 'toc': {}
    \ }

" use a custom markdown style must be absolute path
" like '/Users/username/markdown.css' or expand('~/markdown.css')
let g:mkdp_markdown_css = ''

" use a custom highlight style must absolute path
" like '/Users/username/highlight.css' or expand('~/highlight.css')
let g:mkdp_highlight_css = ''

" use a custom port to start server or empty for random
let g:mkdp_port = ''

" preview page title
" ${name} will be replace with the file name
let g:mkdp_page_title = '「${name}」'

" recognized filetypes
" these filetypes will have MarkdownPreview... commands
let g:mkdp_filetypes = ['markdown']

" set default theme (dark or light)
" By default the theme is define according to the preferences of the system
let g:mkdp_theme = 'dark'

效果:
image

标签:markdown,配置文件,default,set,let,Go,mkdp,preview,Nvim
From: https://www.cnblogs.com/lgdjmyz/p/18462107

相关文章

  • 【开题报告】基于django+vue快递仓库管理系统(论文+源码)计算机毕业设计
    本系统(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。系统程序文件列表开题报告内容研究背景随着电子商务的蓬勃发展和物流行业的快速增长,快递仓库的管理变得日益复杂和关键。传统的仓库管理方式已经难以满足当前高效、精准的管理需......
  • golong下载
    https://www.cnblogs.com/se6c/p/17890974.html#gallery-2目录中文网官网编译器下载额外步骤:加速访问配置GOPROXY环境变量,以下三选一给你们看下我的这一步步骤(我选的阿里)中文网首页-Go语言中文网-Golang中文社区官网TheGoProgrammingLanguage编译器下载1.我......
  • 【开题报告】基于django+vue猫咪咖啡馆管理系统(论文+源码)计算机毕业设计
    本系统(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。系统程序文件列表开题报告内容研究背景在数字化转型的大潮中,各类商业实体纷纷寻求通过信息化手段提升运营效率与用户体验。猫咪咖啡馆作为一种结合了咖啡文化与宠物互动的创意经......
  • go gorm StructField动态生成结构体查询单条表记录
    funcTest014_TakeTableFields(t*testing.T){vardbRequest=Default().SetPageSize(2)dbRequest.TableName="sys_dept"dbRequest.FieldsName="dept_id,dept_name"varresult=dbRequest.GeneralTakeTable()golog.Info......
  • go gorm StructField动态生成结构体查询多条表记录
    water/gowebfuncTest013_GeneralScanTable(t*testing.T){vardbRequest=Default().SetPageSize(3)dbRequest.TableName="sys_dept"dbRequest.FieldsName="dept_id,dept_name"//dbRequest.SetQueryAll(true)varresult=......
  • 基于django+vue+Vue火车票预售系统【开题报告+程序+论文】-计算机毕设
    本系统(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。系统程序文件列表开题报告内容研究背景随着信息技术的飞速发展和人民生活水平的不断提高,铁路出行已成为人们日常生活中不可或缺的交通方式。传统的火车票购买方式,如排队购票或通......
  • 基于django+vue+Vue火车票订票系统【开题报告+程序+论文】-计算机毕设
    本系统(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。系统程序文件列表开题报告内容研究背景随着信息技术的飞速发展和人民生活水平的不断提高,铁路出行已成为人们日常生活中不可或缺的交通方式之一。传统的火车票购买方式,如排队购票......
  • 基于django+vue+Vue皓缘服装厂员工管理系统【开题报告+程序+论文】-计算机毕设
    本系统(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。系统程序文件列表开题报告内容研究背景随着服装行业的快速发展,企业管理面临越来越多的挑战,尤其是人力资源管理方面。皓缘服装厂作为一家具有一定规模的服装制造企业,在日常运营中......
  • 基于django+vue+Vue基于“互联网+”的智慧药房管理系统【开题报告+程序+论文】-计算机
    本系统(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。系统程序文件列表开题报告内容研究背景随着医疗技术的不断进步和人们对健康需求的日益增长,医院药房的管理效率和服务质量成为了医疗体系中不可或缺的一环。传统药房管理模式依赖......
  • 基于django+vue+Vue基于+Mybatis的医生在线诊所平台【开题报告+程序+论文】-计算机毕
    本系统(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。系统程序文件列表开题报告内容研究背景随着互联网技术的飞速发展,医疗行业也迎来了数字化转型的浪潮。传统的就医模式面临着诸多挑战,如医疗资源分配不均、患者就医体验不佳、医生......