Skip to content

Instantly share code, notes, and snippets.

@mhanberg
Last active September 16, 2022 14:27
Show Gist options
  • Save mhanberg/9f4e308477621ad80328eb26aa63eab6 to your computer and use it in GitHub Desktop.
Save mhanberg/9f4e308477621ad80328eb26aa63eab6 to your computer and use it in GitHub Desktop.
(module dotfiles.module.core
{require {core aniseed.core
util dotfiles.util
nvim aniseed.nvim}})
(set nvim.o.syntax "true")
(set nvim.o.splitbelow true)
(set nvim.o.termguicolors true)
(set nvim.o.foldmethod "syntax")
(set nvim.o.foldlevelstart 99)
(set nvim.o.smartindent true)
(set nvim.o.tabstop 2)
(set nvim.o.shiftwidth 2)
(set nvim.o.expandtab true)
(set nvim.o.number true)
(set nvim.o.termguicolors true)
(set nvim.o.backupdir (util.expand "~/.tmp/backup"))
(set nvim.o.directory (util.expand "~/.tmp/swp"))
(set nvim.o.splitright true)
(set nvim.o.lazyredraw true)
(set nvim.o.showmode false)
(set nvim.o.incsearch true)
(set nvim.o.ignorecase true)
(set nvim.o.smartcase true)
(set nvim.o.undofile true)
(set nvim.o.undodir (util.expand "~/.tmp"))
(set nvim.o.mouse "a")
(set nvim.o.errorbells false)
(set nvim.o.visualbell true)
(set nvim.o.t_vb "")
(set nvim.o.cursorline true)
(set nvim.o.background "dark")
(nvim.ex.colorscheme "forest-night")
(set nvim.g.lightline
{
:colorscheme :forest_night
:active {
:left [[:mode :paste] [:readonly :relativepath :modified]]
:right [[:lineinfo] [:percent] [:fileformat :fileencoding :filetype :wordcount]]
}
:component_function {:wordcount "GetWordCount"}
:component_visible_condition {:wordcount "&spell"}
})
(set nvim.g.indentLine_fileTypeExclude [:json])
(set nvim.g.indentLine_char "│")
(set nvim.g.markdown_fenced_languages [:html :vim :ruby :elixir :bash=sh :javascript])
(nvim.ex.command_ "Q q")
(nvim.ex.command_ "Qall qall")
(nvim.ex.command_ "QA qall")
(nvim.ex.command_ "E e")
(nvim.ex.command_ "W w")
(nvim.ex.command_ "Wq wq")
(defn ripgrep-fzf [query fullscreen]
(let [command-fmt "rg --glob '!yarn.lock' --glob '!package-lock.json' --column --line-number --no-heading --color=always --smart-case %s || true"
initial-command (nvim.fn.printf command-fmt (nvim.fn.shellescape query))
reload-command (nvim.fn.printf command-fmt "{q}")
spec {:options ["--phony" "--query" query "--bind" (.. "change:reload:" reload-command)] :window {:width 0.9 :height 0.6 :yoffset 0 :highlight "Normal"}}]
(nvim.fn.fzf#vim#grep initial-command 1 (nvim.fn.fzf#vim#with_preview spec) fullscreen)))
(nvim.ex.command_ "-nargs=* -bang RG lua require'dotfiles.module.core'['ripgrep-fzf'](<q-args>, <bang>0)")
(defn hello-world [] (print "hello world"))
(set nvim.env.FZF_DEFAULT_OPTS "--reverse")
(set nvim.g.fzf_preview_window "")
(set nvim.g.fzf_layout {:window {:width 0.5 :height 0.6 :yoffset 0 :highlight "Normal"}})
(nvim.set_keymap :n "cn" ":cnext<cr>" {:noremap true})
(nvim.set_keymap :n "<leader><space>" ":set hls!<cr>" {:noremap true})
(nvim.set_keymap :n "<leader>ev" ":vsplit ~/.vimrc<cr>" {:noremap true})
(nvim.set_keymap :n "<leader>sv" ":source $MYVIMRC<cr>" {:noremap true})
(nvim.set_keymap :n "<c-p>" ":Files<cr>" {:silent true :noremap true})
(nvim.set_keymap :n "gl" ":BLines<cr>" {:noremap true})
(nvim.set_keymap :n "<leader>a" ":RG<cr>" {:noremap true})
(nvim.set_keymap :n "<leader>gr" ":grep<cr>" {:silent true :noremap true})
(nvim.set_keymap :n "<leader>c" ":botright copen 20<cr>" {:noremap true})
(util.augroup
:random
(fn []
(util.autocmd "VimResized * :wincmd =")
(util.autocmd "GUIEnter * set visualbell t_vb=")
(util.autocmd "FileType netrw call RemoveNetrwMap()")
(util.autocmd "BufRead,BufNewFile *.zsh-theme set filetype=zsh")
(util.autocmd "BufRead,BufNewFile *.lexs set filetype=elixir")))
(util.augroup
:clojure
(fn []
(util.autocmd "BufWritePost *.clj :silent Require")))
(util.augroup
:markdown
(fn []
(util.autocmd "BufRead,BufNewFile *.md setlocal spell")
(util.autocmd "BufRead,BufNewFile *.md setlocal linebreak")
(util.autocmd "BufRead,BufNewFile,BufWritePost *.md let b:word_count = WordCount(expand(\"%:p\"))")))
(module dotfiles.module.core {require {util dotfiles.util
nvim aniseed.nvim
core aniseed.core}})
(set nvim.o.syntax "true")
(set nvim.o.splitbelow true)
(set nvim.o.termguicolors true)
(set nvim.o.foldmethod "syntax")
(set nvim.o.foldlevelstart 99)
(set nvim.o.smartindent true)
(set nvim.o.tabstop 2)
(set nvim.o.shiftwidth 2)
(set nvim.o.expandtab true)
(set nvim.o.number true)
(set nvim.o.termguicolors true)
(set nvim.o.backupdir (util.expand "~/.tmp/backup"))
(set nvim.o.directory (util.expand "~/.tmp/swp"))
(set nvim.o.splitright true)
(set nvim.o.lazyredraw true)
(set nvim.o.showmode false)
(set nvim.o.incsearch true)
(set nvim.o.ignorecase true)
(set nvim.o.smartcase true)
(set nvim.o.undofile true)
(set nvim.o.undodir (util.expand "~/.tmp"))
(set nvim.o.mouse "a")
(set nvim.o.errorbells false)
(set nvim.o.visualbell true)
(set nvim.o.t_vb "")
(set nvim.o.cursorline true)
(set nvim.o.background "dark")
(nvim.ex.colorscheme "forest-night")
(set nvim.g.lightline {:active {:left [["mode" "paste"] ["readonly" "relativepath" "modified"]]
:right [["lineinfo"] ["percent"] ["fileformat" "fileencoding" "filetype" "wordcount"]]}
:colorscheme "forest_night"
:component_function {:wordcount "GetWordCount"}
:component_visible_condition {:wordcount "&spell"}})
(set nvim.g.indentLine_fileTypeExclude ["json"])
(set nvim.g.indentLine_char "│")
(set nvim.g.markdown_fenced_languages ["html" "vim" "ruby" "elixir" "bash=sh" "javascript"])
(nvim.ex.command_ "Q q")
(nvim.ex.command_ "Qall qall")
(nvim.ex.command_ "QA qall")
(nvim.ex.command_ "E e")
(nvim.ex.command_ "W w")
(nvim.ex.command_ "Wq wq")
(defn ripgrep-fzf [query fullscreen] (let [command-fmt "rg --glob '!yarn.lock' --glob '!package-lock.json' --column --line-number --no-heading --color=always --smart-case %s || true"
initial-command (nvim.fn.printf command-fmt (nvim.fn.shellescape query))
reload-command (nvim.fn.printf command-fmt "{q}")
spec {:options ["--phony" "--query" query "--bind" (.. "change:reload:" reload-command)]
:window {:height 0.6
:highlight "Normal"
:width 0.9
:yoffset 0}}]
(nvim.fn.fzf#vim#grep initial-command 1 (nvim.fn.fzf#vim#with_preview spec) fullscreen)))
(nvim.ex.command_ "-nargs=* -bang RG lua require'dotfiles.module.core'['ripgrep-fzf'](<q-args>, <bang>0)")
(defn hello-world [] (print "hello world"))
(set nvim.env.FZF_DEFAULT_OPTS "--reverse")
(set nvim.g.fzf_preview_window "")
(set nvim.g.fzf_layout {:window {:height 0.6
:highlight "Normal"
:width 0.5
:yoffset 0}})
(nvim.set_keymap "n" "cn" ":cnext<cr>" {:noremap true})
(nvim.set_keymap "n" "<leader><space>" ":set hls!<cr>" {:noremap true})
(nvim.set_keymap "n" "<leader>ev" ":vsplit ~/.vimrc<cr>" {:noremap true})
(nvim.set_keymap "n" "<leader>sv" ":source $MYVIMRC<cr>" {:noremap true})
(nvim.set_keymap "n" "<c-p>" ":Files<cr>" {:noremap true
:silent true})
(nvim.set_keymap "n" "gl" ":BLines<cr>" {:noremap true})
(nvim.set_keymap "n" "<leader>a" ":RG<cr>" {:noremap true})
(nvim.set_keymap "n" "<leader>gr" ":grep<cr>" {:noremap true
:silent true})
(nvim.set_keymap "n" "<leader>c" ":botright copen 20<cr>" {:noremap true})
(util.augroup "random" (fn [] (util.autocmd "VimResized * :wincmd =")
(util.autocmd "GUIEnter * set visualbell t_vb=")
(util.autocmd "FileType netrw call RemoveNetrwMap()")
(util.autocmd "BufRead,BufNewFile *.zsh-theme set filetype=zsh")
(util.autocmd "BufRead,BufNewFile *.lexs set filetype=elixir")))
(util.augroup "clojure" (fn [] (util.autocmd "BufWritePost *.clj :silent Require")))
(util.augroup "markdown" (fn [] (util.autocmd "BufRead,BufNewFile *.md setlocal spell")
(util.autocmd "BufRead,BufNewFile *.md setlocal linebreak")
(util.autocmd "BufRead,BufNewFile,BufWritePost *.md let b:word_count = WordCount(expand(\"%:p\"))")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment