Skip to content

Commit

Permalink
refactor(outline.nvim): tweak outline and builtin options (#658)
Browse files Browse the repository at this point in the history
refactor(others)!: migrate from `<leader>qa` to `<leader>qq` for command `:qa!<CR>` (#658)
  • Loading branch information
linrongbin16 authored Dec 27, 2024
1 parent 29abb4a commit 440069d
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 164 deletions.
8 changes: 1 addition & 7 deletions docs/philosophy.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@ No effort is spent on maintaining Neovim's backward compatibility, this config a

Support most popular desktop operating systems, i.e. Windows, Linux and Mac OS. For Linux, support the latest LTS distributions, for example the latest ubuntu-lts.

## Keymap

### CTRL+? Keys

`CTRL+?` (and `CMD+?` for macOS) keys follow most editors' behavior, i.e. use `CTRL+A` to select all, `CTRL+C` to copy, `CTRL+P` to paste, `CTRL+S` to save file, `CTRL+Z` to undo, etc. And copy/paste work with system clipboard.

### Vim Keys
## Key Mappings

- Initial letter of each word as key mapping sequence.
- Same prefix for the same group of functionality.
Expand Down
5 changes: 1 addition & 4 deletions docs/user_guide/global_key_mappings.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@

### Quit

- `<Leader>qt` 🄽 - `:quit<CR>`.
- `<Leader>qT` 🄽 - `:quit!<CR>`.
- `<Leader>qa` 🄽 - `:qall<CR>`.
- `<Leader>qA` 🄽 - `:qall!<CR>`.
- `<Leader>qq` 🄽 - `:qall!<CR>`.

### Folding

Expand Down
2 changes: 1 addition & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ vimloader("preinit")
lualoader("preinit")

-- options
require("builtin.options")
vimloader("lua/builtin/options")
require("builtin.lsp")
require("builtin.diagnostic")

Expand Down
147 changes: 0 additions & 147 deletions lua/builtin/options.lua

This file was deleted.

136 changes: 136 additions & 0 deletions lua/builtin/options.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
" ---- Basic Options ----

" References:
" * https://github.com/tpope/vim-sensible
" * https://github.com/mhinz/vim-galore#tips-1

" cursor movement
set whichwrap+=b,s,<,>,[,]

" complete option
set completeopt+=menu,menuone,preview

" indent
set cindent
set smartindent
set autoindent
set expandtab
set smarttab
set tabstop=2
set softtabstop=2
set shiftwidth=2

" editorconfig
let g:editorconfig=1

" local rc
set exrc

" system clipboard
set clipboard^=unnamedplus

" timeout
set ttimeout
set ttimeoutlen=200
set updatetime=300

" search
set magic
set smartcase
set ignorecase
set hlsearch
set incsearch

" clean highlight
nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L>
" match brackets
set showmatch

" cursor/line/column
set wrap
set cursorline
set nocursorcolumn
" set colorcolumn=120
set number
set norelativenumber
set signcolumn=yes

" statusline
set ruler
set noshowmode
set laststatus=3

" command line, message
set wildmenu
set showcmd
set display+=lastline,truncate
set shortmess+=c
" set cmdheight=2

" scroll
set scrolloff=1
set sidescroll=1
set sidescrolloff=2

" whitespace
set list
set listchars=tab:>·,trail:~,extends:>,precedes:<,nbsp:+
" set listchars=eol:¬,tab:>·,trail:~,extends:>,precedes:<,space:␣,nbsp:+


" render
set redrawtime=1000
set maxmempattern=2000000

" tags
set tags+=./tags;,tags

" files
set autoread
set autowrite
set noswapfile
set noconfirm
autocmd FocusGained,BufEnter,TermEnter,TermLeave * checktime

" encodings
set fileencoding=utf-8
set fileencodings+=ucs-bom,utf-8,cp936,gb18030,gbk,big5,euc-jp,euc-kr,default,latin1
set encoding=utf-8
" set termencoding=utf-8
" set fileformat=unix
" set fileformats=unix,dos,mac

" command history
set history=1000
" tabs
set tabpagemax=100
" buffers
set hidden

" options
set formatoptions+=j
set sessionoptions-=options
set viewoptions-=options

" color
set termguicolors
set background=dark

" language
set nolangremap
set langmenu=en_US

" mouse, selection
set mouse=a
set selection=exclusive
set selectmode=mouse,key

" fold
set foldenable
set foldlevel=100
set foldnestmax=100
set foldmethod=indent

" jump
set jumpoptions=stack,view
5 changes: 1 addition & 4 deletions lua/builtin/others.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ set_key(
":noa w<CR>",
{ silent = false, desc = "Save file without formatting" }
)
set_key({ "n", "x" }, "<leader>qt", ":quit<CR>", { silent = false, desc = ":quit" })
set_key({ "n", "x" }, "<leader>qT", ":quit!<CR>", { silent = false, desc = ":quit!" })
set_key({ "n", "x" }, "<leader>qa", ":qall<CR>", { silent = false, desc = ":qall" })
set_key({ "n", "x" }, "<leader>qA", ":qall!<CR>", { silent = false, desc = ":qall!" })
set_key({ "n", "x" }, "<leader>qq", ":qall!<CR>", { silent = false, desc = ":qall!" })
set_key(
{ "n", "x" },
"<leader>zz",
Expand Down
2 changes: 1 addition & 1 deletion lua/configs/hedyhli/outline-nvim/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require("outline").setup({
focus_on_open = false,
},
symbol_folding = {
autofold_depth = 2,
autofold_depth = 5,
auto_unfold = {
hovered = false,
},
Expand Down

0 comments on commit 440069d

Please sign in to comment.