feat: open md

This commit is contained in:
2022-03-01 10:12:33 +08:00
parent 55d04782fa
commit 554068c22c
8 changed files with 51 additions and 28 deletions
+7
View File
@@ -100,10 +100,17 @@ source $ZSH/oh-my-zsh.sh
bindkey "^b" backward-word bindkey "^b" backward-word
bindkey "^f" forward-word bindkey "^f" forward-word
# Turn off all beeps
unsetopt BEEP
# Turn off autocomplete beeps
# unsetopt LIST_BEEP
# brew # brew
export HOMEBREW_NO_AUTO_UPDATE=true # 禁止 brew 每次安装软件都 upate export HOMEBREW_NO_AUTO_UPDATE=true # 禁止 brew 每次安装软件都 upate
# go # go
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
export GOPROXY=goproxy.cn export GOPROXY=goproxy.cn
export GOSUMDB="sum.golang.google.cn" export GOSUMDB="sum.golang.google.cn"
+24 -21
View File
@@ -1,27 +1,30 @@
[user] [user]
name = Laily name = Laily
email = i@laily.net email = i@laily.net
[core] [core]
autocrlf = input autocrlf = input
quotepath = false quotepath = false
editor = /usr/local/bin/nvim editor = /usr/local/bin/nvim
excludesfile = ~/.dotfile/git/.gitignore excludesfile = ~/.dotfile/git/.gitignore
[alias] [alias]
au = add -u au = add -u
co = checkout co = checkout
cm = commit -m cm = commit -m
st = status st = status
ap = add -p ap = add -p
br = branch br = branch
pl = pull pl = pull
pt = push origin --tags pt = push origin --tags
merge2 = "!f() { git checkout $1 && git merge $2 && git checkout -; }; f" merge2 = "!f() { git checkout $1 && git merge $2 && git checkout -; }; f"
bg = "!f() { git branch | grep $1; }; f" bg = "!f() { git branch | grep $1; }; f"
delbr = "!f(){ git branch -D $(git branch | grep \"\b$1\"); };f" delbr = "!f(){ git branch -D $(git branch | grep \"\b$1\"); };f"
can = commit --amend --no-edit can = commit --amend --no-edit
cleanbr = "!git branch --merged master | grep -v '\\*\\|master\\|main' | xargs -n 1 git branch -d"
[push] [push]
default = current default = current
[merge] [merge]
tool = vimdiff tool = vimdiff
[include] [include]
path = ~/.subgitconfig path = ~/.subgitconfig
[branch]
autoSetupMerge = always
+2 -2
View File
@@ -14,10 +14,10 @@ require'nvim-tree'.setup {
}, },
update_focused_file = { update_focused_file = {
-- enables the feature -- enables the feature
enable = false, enable = true,
-- update the root directory of the tree to the one of the folder containing the file if the file is not under the current root directory -- update the root directory of the tree to the one of the folder containing the file if the file is not under the current root directory
-- only relevant when `update_focused_file.enable` is true -- only relevant when `update_focused_file.enable` is true
update_cwd = false, update_cwd = true,
-- list of buffer names / filetypes that will not update the cwd if the file isn't found under the current root directory -- list of buffer names / filetypes that will not update the cwd if the file isn't found under the current root directory
-- only relevant when `update_focused_file.update_cwd` is true and `update_focused_file.enable` is true -- only relevant when `update_focused_file.update_cwd` is true and `update_focused_file.enable` is true
ignore_list = {} ignore_list = {}
+3 -3
View File
@@ -1,6 +1,5 @@
local treesitter = { local treesitter = {
ensure_installed = "all", ensure_installed = "all",
ignore_install = {"haskell","markdown"},
highlight = {enabled = true}, highlight = {enabled = true},
playground = {enabled = true}, playground = {enabled = true},
rainbow = {enabled = false}, rainbow = {enabled = false},
@@ -8,13 +7,14 @@ local treesitter = {
require'nvim-treesitter.configs'.setup { require'nvim-treesitter.configs'.setup {
ensure_installed = treesitter.ensure_installed, -- one of "all", "maintained" (parsers with maintainers), or a list of languages ensure_installed = treesitter.ensure_installed, -- one of "all", "maintained" (parsers with maintainers), or a list of languages
ignore_install = treesitter.ignore_install, ignore_install = {"haskell", "markdown"},
matchup = { matchup = {
enable = true, -- mandatory, false will disable the whole extension enable = true, -- mandatory, false will disable the whole extension
-- disable = { "c", "ruby" }, -- optional, list of language that will be disabled -- disable = { "c", "ruby" }, -- optional, list of language that will be disabled
}, },
highlight = { highlight = {
enable = treesitter.highlight.enabled -- false will disable the whole extension enable = treesitter.highlight.enabled, -- false will disable the whole extension
disable = { "markdown" },
}, },
context_commentstring = { context_commentstring = {
enable = true, enable = true,
+1
View File
@@ -131,6 +131,7 @@ local mappings = {
}, },
f = { f = {
name = "+File", name = "+File",
m = {"<cmd>lua require'utils'.open_md()<cr>", "open a markdown file in vscode"},
s = {"<cmd>w<cr>", "save file"}, s = {"<cmd>w<cr>", "save file"},
t = {"<cmd>NvimTreeToggle<cr>", "toggle nvim tree"}, t = {"<cmd>NvimTreeToggle<cr>", "toggle nvim tree"},
r = {"<cmd>RnvimrToggle<cr>", "toggle rnvimr"}, r = {"<cmd>RnvimrToggle<cr>", "toggle rnvimr"},
+8 -1
View File
@@ -173,7 +173,14 @@ return require("packer").startup(function(use)
end end
} }
use {'SidOfc/mkdx'} -- markdown
use {'godlygeek/tabular'}
use {'preservim/vim-markdown'}
use {
'iamcco/markdown-preview.nvim',
run = function() vim.fn['mkdp#util#install']() end,
ft = {'markdown'}
}
--use 'EdenEast/nightfox.nvim' --use 'EdenEast/nightfox.nvim'
-- use {'godlygeek/tabular', opt=true} -- use {'godlygeek/tabular', opt=true}
+1 -1
View File
@@ -6,7 +6,7 @@ vim.o.title = true
TERMINAL = vim.fn.expand('$TERMINAL') TERMINAL = vim.fn.expand('$TERMINAL')
vim.cmd('let &titleold="'..TERMINAL..'"') vim.cmd('let &titleold="'..TERMINAL..'"')
vim.o.titlestring="%<%F%=%l/%L - nvim" vim.o.titlestring="%<%F%=%l/%L - nvim"
vim.wo.wrap = false -- Display long lines as just one line vim.wo.wrap = true -- Display long lines as just one line
vim.cmd('set whichwrap+=<,>,[,],h,l') -- move to next line with theses keys vim.cmd('set whichwrap+=<,>,[,],h,l') -- move to next line with theses keys
vim.cmd('syntax on') -- syntax highlighting vim.cmd('syntax on') -- syntax highlighting
vim.o.pumheight = 10 -- Makes popup menu smaller vim.o.pumheight = 10 -- Makes popup menu smaller
+5
View File
@@ -8,6 +8,11 @@ function lv_utils.yank_filepath()
vim.fn.setreg('+',p) vim.fn.setreg('+',p)
end end
function lv_utils.open_md()
local p = vim.fn.expand('%:p')
vim.fn.system("open -a typora "..p)
end
function lv_utils.define_augroups(definitions) -- {{{1 function lv_utils.define_augroups(definitions) -- {{{1
-- Create autocommand groups based on the passed definitions -- Create autocommand groups based on the passed definitions
-- --