浏览代码

Easteregg

main
Cian Butler 2 个月前
父节点
当前提交
8da6411dcc
签署人:: butlerx GPG 密钥 ID: B37CA765BAA89170
共有 18 个文件被更改,包括 119 次插入118 次删除
  1. +1
    -1
      config/nvim/filetype.vim
  2. +0
    -10
      config/nvim/ftplugin/csv.vim
  3. +5
    -0
      config/nvim/ftplugin/go.lua
  4. +7
    -0
      config/nvim/ftplugin/json.lua
  5. +0
    -2
      config/nvim/ftplugin/json.vim
  6. +21
    -0
      config/nvim/ftplugin/markdown.lua
  7. +0
    -8
      config/nvim/ftplugin/markdown.vim
  8. +7
    -0
      config/nvim/ftplugin/terraform.lua
  9. +0
    -2
      config/nvim/ftplugin/terraform.vim
  10. +0
    -10
      config/nvim/ftplugin/tsv.vim
  11. +0
    -0
      config/nvim/indent/apache.vim
  12. +12
    -0
      config/nvim/indent/csv.lua
  13. +0
    -11
      config/nvim/indent/csv.vim
  14. +13
    -0
      config/nvim/indent/password.lua
  15. +0
    -11
      config/nvim/indent/password.vim
  16. +3
    -3
      config/nvim/indent/tsv.lua
  17. +50
    -0
      config/nvim/lua/scripts.lua
  18. +0
    -60
      config/nvim/scripts.vim

+ 1
- 1
config/nvim/filetype.vim 查看文件

@@ -310,7 +310,7 @@ augroup filetypedetect
autocmd BufNewFile,BufRead,StdinReadPost
\ *
\ if !did_filetype()
\| runtime scripts.vim
\| lua require'scripts'
\|endif

" If supported, on leaving insert mode, check whether the first line was


+ 0
- 10
config/nvim/ftplugin/csv.vim 查看文件

@@ -1,10 +0,0 @@
" Only do this when not yet done for this buffer
if exists('b:did_ftplugin')
finish
endif

" No autoformatting, literal tabs
setlocal noautoindent
setlocal noexpandtab
setlocal formatoptions=
let b:undo_ftplugin = 'setlocal autoindent< expandtab< formatoptions<'

+ 5
- 0
config/nvim/ftplugin/go.lua 查看文件

@@ -1,3 +1,8 @@
-- Only do this when not yet done for this buffer
if vim.b.did_ftplugin then
return
end

vim.g.go_fmt_autosave = 0
vim.g.go_imports_autosave = 0
vim.g.go_metalinter_autosave = 0


+ 7
- 0
config/nvim/ftplugin/json.lua 查看文件

@@ -0,0 +1,7 @@
-- Only do this when not yet done for this buffer
if vim.b.did_ftplugin then
return
end

-- vim-json
vim.g.vim_json_syntax_conceal = 0

+ 0
- 2
config/nvim/ftplugin/json.vim 查看文件

@@ -1,2 +0,0 @@
" vim-json
let g:vim_json_syntax_conceal = 0

+ 21
- 0
config/nvim/ftplugin/markdown.lua 查看文件

@@ -0,0 +1,21 @@
-- Only do this when not yet done for this buffer
if vim.b.did_ftplugin then
return
end

vim.opt.complete:append { "kspell" }
vim.g.vim_markdown_conceal = 0
vim.g.vim_markdown_math = 1
vim.g.vim_markdown_frontmatter = 1
vim.g.vim_markdown_toml_frontmatter = 1
vim.g.vim_markdown_json_frontmatter = 1
vim.g.vim_markdown_new_list_item_indent = 2
vim.g.markdown_fenced_languages = {
"html",
"python",
"bash=sh",
"javascript",
"c++=cpp",
"viml=vim",
"ini=dosini",
}

+ 0
- 8
config/nvim/ftplugin/markdown.vim 查看文件

@@ -1,8 +0,0 @@
set complete+=kspell
let g:vim_markdown_conceal = 0
let g:vim_markdown_math = 1
let g:vim_markdown_frontmatter = 1
let g:vim_markdown_toml_frontmatter = 1
let g:vim_markdown_json_frontmatter = 1
let g:vim_markdown_new_list_item_indent = 2
let g:markdown_fenced_languages = ['html', 'python', 'bash=sh', 'javascript', 'c++=cpp', 'viml=vim', 'ini=dosini']

+ 7
- 0
config/nvim/ftplugin/terraform.lua 查看文件

@@ -0,0 +1,7 @@
-- Only do this when not yet done for this buffer
if vim.b.did_ftplugin then
return
end

vim.g.terraform_align = 1
vim.g.terraform_fmt_on_save = 1

+ 0
- 2
config/nvim/ftplugin/terraform.vim 查看文件

@@ -1,2 +0,0 @@
let g:terraform_align=1
let g:terraform_fmt_on_save=1

+ 0
- 10
config/nvim/ftplugin/tsv.vim 查看文件

@@ -1,10 +0,0 @@
" Only do this when not yet done for this buffer
if exists('b:did_ftplugin')
finish
endif

" No autoformatting, literal tabs
setlocal noautoindent
setlocal noexpandtab
setlocal formatoptions=
let b:undo_ftplugin = 'setlocal autoindent< expandtab< formatoptions<'

config/nvim/ftplugin/apache.vim → config/nvim/indent/apache.vim 查看文件


+ 12
- 0
config/nvim/indent/csv.lua 查看文件

@@ -0,0 +1,12 @@
local setlocal = vim.bo
-- Only do this when not done yet for this buffer
if vim.b.did_indent then
return
end
vim.b.did_indent = 1

-- Manual indenting and literal tabs for CSVs
setlocal.autoindent = false
setlocal.expandtab = false
setlocal.softtabstop = 0
vim.b.undo_indent = "setlocal autoindent< expandtab< softtabstop<"

+ 0
- 11
config/nvim/indent/csv.vim 查看文件

@@ -1,11 +0,0 @@
" Only do this when not done yet for this buffer
if exists('b:did_indent')
finish
endif
let b:did_indent = 1

" Manual indenting and literal tabs for CSVs
setlocal noautoindent
setlocal noexpandtab
setlocal softtabstop=0
let b:undo_indent = 'setlocal autoindent< expandtab< softtabstop<'

+ 13
- 0
config/nvim/indent/password.lua 查看文件

@@ -0,0 +1,13 @@
local setlocal = vim.bo
-- Only do this when not done yet for this buffer
if vim.b.did_indent then
return
end
vim.b.did_indent = 1


" Manual indenting and literal tabs for passwords
setlocal.noautoindent= true
setlocal.noexpandtab= true
setlocal.softtabstop=0
vim.b.undo_indent = 'setlocal autoindent< expandtab< softtabstop<'

+ 0
- 11
config/nvim/indent/password.vim 查看文件

@@ -1,11 +0,0 @@
" Only do this when not done yet for this buffer
if exists('b:did_indent')
finish
endif
let b:did_indent = 1

" Manual indenting and literal tabs for passwords
setlocal noautoindent
setlocal noexpandtab
setlocal softtabstop=0
let b:undo_indent = 'setlocal autoindent< expandtab< softtabstop<'

+ 3
- 3
config/nvim/indent/tsv.lua 查看文件

@@ -1,12 +1,12 @@
local setlocal = vim.bo
-- Only do this when not done yet for this buffer
if vim.b.did_indent then
vim.fn.finish()
return
end
vim.b.did_indent = 1

-- Manual indenting and literal tabs for TSVs
setlocal.noautoindent = true
setlocal.noexpandtab = true
setlocal.autoindent = false
setlocal.expandtab = false
setlocal.softtabstop = 0
vim.b.undo_indent = "setlocal autoindent< expandtab< softtabstop<"

+ 50
- 0
config/nvim/lua/scripts.lua 查看文件

@@ -0,0 +1,50 @@
-- Try to determine filetype by examining actual file contents; read as little
-- as possible, and try to keep things simple and specific to what I typically
-- work on, and will expect to be syntax-highlighted.
-- Read first line
local line = vim.fn.getline(1)
local filetype = vim.opt.filetype

-- If it's not a shebang, we're done

if not line.starts "^#!" then
return
end

if line.find "<[gm]=awk>" then
-- AWK
filetype = "awk"
elseif line.find "<perl5=>" then
-- Perl 5
filetype = "perl"
elseif line.find "<perl6>" then
-- Perl 6
filetype = "perl6"
elseif line.find "<php>" then
-- PHP
filetype = "php"
elseif line.find "<python[23]=>" then
-- Python
filetype = "python"
elseif line.find "<ruby[23]=>" then
-- Ruby
filetype = "ruby"
elseif line.find "<sed>" then
-- sed
filetype = "sed"
elseif line.find "<bash>" then
-- Bash
vim.b.is_bash = true
filetype = "sh"
elseif line.find "<%(ksh|ksh93|mksh|pdksh)>" then
-- Korn shell
vim.b.is_kornshell = true
filetype = "sh"
elseif line.find "<sh>" then
-- POSIX/Bourne shell
vim.b.is_posix = 1
filetype = "sh"
elseif line.find "<%(tcl|wish)>" then
-- TCL
filetype = "tcl"
end

+ 0
- 60
config/nvim/scripts.vim 查看文件

@@ -1,60 +0,0 @@
" Try to determine filetype by examining actual file contents; read as little
" as possible, and try to keep things simple and specific to what I typically
" work on, and will expect to be syntax-highlighted.

" Read first line
let s:line = getline(1)

" If it's not a shebang, we're done
if s:line !~# '^#!'
finish
endif

" AWK
if s:line =~# '\<[gm]\=awk\>'
setfiletype awk

" Perl 5
elseif s:line =~# '\<perl5\=\>'
setfiletype perl

" Perl 6
elseif s:line =~# '\<perl6\>'
setfiletype perl6

" PHP
elseif s:line =~# '\<php\>'
setfiletype php

" Python
elseif s:line =~# '\<python[23]\=\>'
setfiletype python

" Ruby
elseif s:line =~# '\<ruby[23]\=\>'
setfiletype ruby

" sed
elseif s:line =~# '\<sed\>'
setfiletype sed

" Bash
elseif s:line =~# '\<bash\>'
let b:is_bash = 1
setfiletype sh

" Korn shell
elseif s:line =~# '\<\%(\ksh\|ksh93\|mksh\|pdksh\)\>'
let b:is_kornshell = 1
setfiletype sh

" POSIX/Bourne shell
elseif s:line =~# '\<sh\>'
let b:is_posix = 1
setfiletype sh

" TCL
elseif s:line =~# '\<\%(tcl\|wish\)\>'
setfiletype tcl

endif

正在加载...
取消
保存