-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
85 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,58 @@ | ||
;; options | ||
(let [opts {;; 言語メニューを無効にする | ||
:langmenu :none | ||
;; shortmessオプションにsWIcCSを追加 | ||
:shortmess (.. vim.o.shortmess :sWIcCS) | ||
;; コマンドラインの高さを0に設定 | ||
:cmdheight 0 | ||
;; guifg, guibgの有効化 | ||
:termguicolors true | ||
;; モードを非表示 | ||
:showmode false | ||
;; 起動時に行数を非表示表示 | ||
:number false | ||
;; signcolumnを起動時に非表示 | ||
:signcolumn :no | ||
;; tablineを起動時に非表示 | ||
:showtabline 0 | ||
;; statuslineを起動時に非表示 | ||
:laststatus 0 | ||
:foldlevel 99 | ||
:foldlevelstart 99}] | ||
(vim.loader.enable) | ||
(each [k v (pairs opts)] | ||
(tset vim.o k v))) | ||
(vim.loader.enable) | ||
(each [k v (pairs {;; 言語メニューを無効にする | ||
:langmenu :none | ||
;; shortmessオプションにsWIcCSを追加 | ||
:shortmess (.. vim.o.shortmess :sWIcCS) | ||
;; コマンドラインの高さを0に設定 | ||
:cmdheight 0 | ||
;; guifg, guibgの有効化 | ||
:termguicolors true | ||
;; モードを非表示 | ||
:showmode false | ||
;; 起動時に行数を非表示表示 | ||
:number false | ||
;; signcolumnを起動時に非表示 | ||
:signcolumn :no | ||
;; tablineを起動時に非表示 | ||
:showtabline 0 | ||
;; statuslineを起動時に非表示 | ||
:laststatus 0 | ||
:foldlevel 99 | ||
:foldlevelstart 99})] | ||
(tset vim.o k v)) | ||
|
||
;; keymaps | ||
(set vim.g.mapleader " ") | ||
(set vim.g.maplocalleader ",") | ||
|
||
(let [map vim.keymap.set | ||
cmd (fn [c] (.. :<cmd> c :<cr>)) | ||
opts {:noremap true :silent true} | ||
N [[:<leader> ":lua vim.cmd('doautocmd User TriggerLeader')<CR>"] | ||
[";" ":"] | ||
] | ||
V [[";" ":"] | ||
]] | ||
;; normal mode keymaps | ||
(each [_ K (ipairs N)] | ||
(map :n (. K 1) (. K 2) (or (. K 3) opts))) | ||
;; visual mode keymaps | ||
(each [_ K (ipairs V)] | ||
(map :v (. K 1) (. K 2) (or (. K 3) opts))) | ||
(let [M vim.keymap.set | ||
C (fn [c] (.. :<cmd> c :<cr>)) | ||
O {:noremap true :silent true}] | ||
;; keymaps | ||
(each [_ K (ipairs [[:n | ||
:<leader> | ||
":lua vim.cmd('doautocmd User TriggerLeader')<CR>"] | ||
[:n ";" ":"] | ||
[:v ";" ":"]])] | ||
(M (. K 1) (. K 2) (. K 3) O)) | ||
;; term toggle keymaps | ||
(for [i 0 9] | ||
(map [:n :t :i] (.. :<C- i ">") (cmd (.. "TermToggle " i)) opts))) | ||
(M [:n :t :i] (.. :<C- i ">") (C (.. "TermToggle " i)) O))) | ||
|
||
;; user events | ||
(var specificFileEnterAutoCmd nil) | ||
|
||
;; SpecificFileEnter | ||
(let [A vim.api | ||
gen A.nvim_create_autocmd | ||
exec A.nvim_exec_autocmds | ||
del A.nvim_del_autocmd] | ||
(let [A vim.api] | ||
(set specificFileEnterAutoCmd | ||
(gen :FileType | ||
{:callback (fn [] | ||
(if (not= vim.bo.filetype "") | ||
(do | ||
(exec :User {:pattern :SpecificFileEnter}) | ||
(del specificFileEnterAutoCmd))))}))) | ||
(A.nvim_create_autocmd :FileType | ||
{:callback (fn [] | ||
(if (let [F vim.bo.filetype] | ||
(not (or (= F "") | ||
(= F :prompt) | ||
(= F :nofile)))) | ||
(do | ||
(A.nvim_exec_autocmds :User | ||
{:pattern :SpecificFileEnter}) | ||
(A.nvim_del_autocmd specificFileEnterAutoCmd))))}))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.