From a97404c7971ad38662e6b7850dab09e047591c18 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Tue, 5 Jul 2022 19:39:52 -0700 Subject: [PATCH] port over more settings from vim --- nvim/fnl/init.fnl | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/nvim/fnl/init.fnl b/nvim/fnl/init.fnl index 22837e3..f8a1120 100644 --- a/nvim/fnl/init.fnl +++ b/nvim/fnl/init.fnl @@ -1,6 +1,7 @@ (vim.cmd "colorscheme paramount") (set vim.opt.foldlevel 1) +(set vim.opt.linebreak true) (set vim.opt.list true) ;; fnlfmt: skip @@ -11,18 +12,35 @@ :nbsp "\\u00b7"}) (set vim.opt.number true) +(set vim.opt.showmode false) +(set vim.opt.termguicolors true) +(set vim.opt.virtualedit :block) +(set vim.opt.wildmode "longest:full") + +;; search +(set vim.opt.gdefault true) +(set vim.opt.ignorecase true) +(set vim.opt.smartcase true) (set vim.g.mapleader " ") -;; move the cursor to the first non-blank character with H -(vim.keymap.set :n :H "^" {:noremap true}) +;; disable arrow keys +(each [_ v (ipairs [:up :down :left :right])] + (vim.keymap.set :n (.. "<" v ">") :)) ;; quick save -(vim.keymap.set :n "\\\\" ":write" {:noremap true}) -(vim.keymap.set :i "\\\\" ":write" {:noremap true}) +(vim.keymap.set :n "\\\\" ":write") +(vim.keymap.set :i "\\\\" ":write") ;; clear highlight -(vim.keymap.set :n :/ ":nohlsearch" {:noremap true}) +(vim.keymap.set :n :/ ":nohlsearch") + +;; non-shifted shortcuts for moving the cursor to the start/end of the current line +(vim.keymap.set :n :H "^") +(vim.keymap.set :n :L "$") + +;; re-run the last macro +(vim.keymap.set :n :Q "@@") ;;; restore cursor location @@ -53,6 +71,17 @@ ;; (require :ale) (require :fzf) +;;; lightline + +;; https://github.com/itchyny/lightline.vim/issues/168#issuecomment-232183744 +(let [colorscheme :powerline + palette-key (.. "lightline#colorscheme#" colorscheme "#palette") + palette (. vim.g palette-key)] + (set vim.g.lightline {: colorscheme}) + (each [_ f (ipairs [:normal :inactive :tabline])] + (tset palette f :middle [[:NONE :NONE :NONE :NONE]])) + (tset vim.g palette-key palette)) + ;;; lint (let [lint (require :lint)