Switch airline for lualine, vista for aerial
Move lua config into init.lua (LSP still in separate file) Remove slime, add toggleterm
This commit is contained in:
parent
808d53cdd6
commit
fc3f8d5901
18
init.lua
Normal file
18
init.lua
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
-- lualine config
|
||||||
|
require('lualine').setup{
|
||||||
|
options = {
|
||||||
|
icons_enabled = false,
|
||||||
|
theme = 'auto',
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
-- lualine_x = {'encoding', 'fileformat', 'filetype'},
|
||||||
|
lualine_x = {'aerial', 'filetype'}
|
||||||
|
},
|
||||||
|
extensions = {'aerial', 'fugitive', 'fzf', 'nerdtree', 'toggleterm'}
|
||||||
|
}
|
||||||
|
|
||||||
|
-- toggleterm config
|
||||||
|
require('toggleterm').setup{
|
||||||
|
size = 20,
|
||||||
|
hide_numbers = true -- hide the number column in toggleterm buffers
|
||||||
|
}
|
52
init.vim
52
init.vim
|
@ -21,15 +21,15 @@ Plug 'mileszs/ack.vim'
|
||||||
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
|
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
|
||||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
||||||
Plug 'junegunn/fzf.vim'
|
Plug 'junegunn/fzf.vim'
|
||||||
Plug 'liuchengxu/vista.vim'
|
Plug 'stevearc/aerial.nvim'
|
||||||
Plug 'tpope/vim-unimpaired'
|
Plug 'tpope/vim-unimpaired'
|
||||||
Plug 'tpope/vim-fugitive'
|
Plug 'tpope/vim-fugitive'
|
||||||
Plug 'tpope/vim-commentary'
|
Plug 'tpope/vim-commentary'
|
||||||
Plug 'airblade/vim-gitgutter'
|
Plug 'airblade/vim-gitgutter'
|
||||||
Plug 'vim-airline/vim-airline'
|
Plug 'nvim-lualine/lualine.nvim'
|
||||||
Plug 'vim-airline/vim-airline-themes'
|
Plug 'kyazdani42/nvim-web-devicons'
|
||||||
Plug 'christoomey/vim-tmux-navigator'
|
Plug 'christoomey/vim-tmux-navigator'
|
||||||
Plug 'jpalardy/vim-slime'
|
Plug 'akinsho/toggleterm.nvim', {'tag' : 'v2.*'}
|
||||||
Plug 'hrsh7th/cmp-nvim-lsp'
|
Plug 'hrsh7th/cmp-nvim-lsp'
|
||||||
Plug 'hrsh7th/cmp-buffer'
|
Plug 'hrsh7th/cmp-buffer'
|
||||||
Plug 'hrsh7th/cmp-path'
|
Plug 'hrsh7th/cmp-path'
|
||||||
|
@ -44,6 +44,7 @@ call plug#end()
|
||||||
set mouse=nv
|
set mouse=nv
|
||||||
let g:python3_host_prog = '~/.pyenv/versions/neovim3/bin/python'
|
let g:python3_host_prog = '~/.pyenv/versions/neovim3/bin/python'
|
||||||
|
|
||||||
|
luafile ~/.vim/init.lua
|
||||||
luafile ~/.vim/lsp_config.lua
|
luafile ~/.vim/lsp_config.lua
|
||||||
|
|
||||||
map ; :Files<CR>
|
map ; :Files<CR>
|
||||||
|
@ -55,7 +56,6 @@ if exists('+termguicolors') && ($COLORTERM == "24bit" || $COLORTERM == "truecolo
|
||||||
set termguicolors
|
set termguicolors
|
||||||
endif
|
endif
|
||||||
colorscheme onehalfdark
|
colorscheme onehalfdark
|
||||||
let g:airline_theme='onehalfdark'
|
|
||||||
|
|
||||||
set cursorline
|
set cursorline
|
||||||
let mapleader=","
|
let mapleader=","
|
||||||
|
@ -86,16 +86,12 @@ set autoindent
|
||||||
set smartindent
|
set smartindent
|
||||||
filetype plugin indent on
|
filetype plugin indent on
|
||||||
|
|
||||||
let g:vista_default_executive = 'nvim_lsp'
|
|
||||||
let g:vista_fzf_preview = ['right:50%']
|
|
||||||
|
|
||||||
imap jk <Esc>
|
imap jk <Esc>
|
||||||
command Bd b# | bd #
|
command Bd b# | bd #
|
||||||
command! BufOnly silent! execute "%bd|e#|bd#"
|
command! BufOnly silent! execute "%bd|e#|bd#"
|
||||||
nnoremap <Leader>b :buffers<CR>:buffer<Space>
|
nnoremap <Leader>b :buffers<CR>:buffer<Space>
|
||||||
nnoremap <leader>n :NERDTreeFocus<CR>
|
nnoremap <leader>n :NERDTreeFocus<CR>
|
||||||
nnoremap <leader>k :Vista<CR>
|
nnoremap <leader>; :call aerial#fzf()<CR>
|
||||||
nnoremap <leader>; :Vista finder<CR>
|
|
||||||
nnoremap <C-n> :NERDTree<CR>
|
nnoremap <C-n> :NERDTree<CR>
|
||||||
nnoremap <C-t> :NERDTreeToggle<CR>
|
nnoremap <C-t> :NERDTreeToggle<CR>
|
||||||
nnoremap <C-f> :NERDTreeFind<CR>
|
nnoremap <C-f> :NERDTreeFind<CR>
|
||||||
|
@ -108,39 +104,3 @@ set splitbelow
|
||||||
set splitright
|
set splitright
|
||||||
|
|
||||||
let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+'
|
let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+'
|
||||||
|
|
||||||
let g:slime_target = "tmux"
|
|
||||||
let g:slime_default_config = {"socket_name": get(split($TMUX, ","), 0), "target_pane": "{last}"}
|
|
||||||
|
|
||||||
" function! GitStatus()
|
|
||||||
" let [a,m,r] = GitGutterGetHunkSummary()
|
|
||||||
" return printf('%s +%d ~%d -%d', FugitiveHead(), a, m, r)
|
|
||||||
" endfunction
|
|
||||||
"
|
|
||||||
" let g:lightline = { 'colorscheme': 'onehalfdark' }
|
|
||||||
" let g:lightline.component_expand = {
|
|
||||||
" \ 'linter_checking': 'lightline#ale#checking',
|
|
||||||
" \ 'linter_infos': 'lightline#ale#infos',
|
|
||||||
" \ 'linter_warnings': 'lightline#ale#warnings',
|
|
||||||
" \ 'linter_errors': 'lightline#ale#errors',
|
|
||||||
" \ 'linter_ok': 'lightline#ale#ok',
|
|
||||||
" \ }
|
|
||||||
" let g:lightline.component_type = {
|
|
||||||
" \ 'linter_checking': 'right',
|
|
||||||
" \ 'linter_infos': 'right',
|
|
||||||
" \ 'linter_warnings': 'warning',
|
|
||||||
" \ 'linter_errors': 'error',
|
|
||||||
" \ 'linter_ok': 'right',
|
|
||||||
" \ }
|
|
||||||
" let g:lightline.component_function = {
|
|
||||||
" \ 'gitstatus': 'GitStatus'
|
|
||||||
" \ }
|
|
||||||
" let g:lightline.active = {
|
|
||||||
" \ 'left': [ [ 'mode', 'paste' ],
|
|
||||||
" \ [ 'gitstatus', 'readonly', 'filename', 'modified' ] ],
|
|
||||||
" \ 'right': [ [ 'linter_checking', 'linter_errors', 'linter_warnings', 'linter_infos', 'linter_ok', 'lineinfo' ],
|
|
||||||
" \ [ 'percent' ],
|
|
||||||
" \ [ 'fileformat', 'fileencoding', 'filetype' ] ]
|
|
||||||
" \ }
|
|
||||||
" set laststatus=0
|
|
||||||
" set noshowmode
|
|
||||||
|
|
|
@ -6,6 +6,20 @@ vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
||||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
||||||
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
||||||
|
|
||||||
|
-- Setup aerial
|
||||||
|
require('aerial').setup{
|
||||||
|
on_attach = function(bufnr)
|
||||||
|
-- Toggle the aerial window with <leader>a
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>k', '<cmd>AerialToggle!<CR>', {})
|
||||||
|
-- Jump forwards/backwards with '{' and '}'
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '{', '<cmd>AerialPrev<CR>', {})
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '}', '<cmd>AerialNext<CR>', {})
|
||||||
|
-- Jump up the tree with '[[' or ']]'
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '[[', '<cmd>AerialPrevUp<CR>', {})
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', ']]', '<cmd>AerialNextUp<CR>', {})
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
-- Use an on_attach function to only map the following keys
|
-- Use an on_attach function to only map the following keys
|
||||||
-- after the language server attaches to the current buffer
|
-- after the language server attaches to the current buffer
|
||||||
local on_attach = function(client, bufnr)
|
local on_attach = function(client, bufnr)
|
||||||
|
@ -30,6 +44,8 @@ local on_attach = function(client, bufnr)
|
||||||
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
||||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||||
vim.keymap.set('n', '<space>f', vim.lsp.buf.formatting, bufopts)
|
vim.keymap.set('n', '<space>f', vim.lsp.buf.formatting, bufopts)
|
||||||
|
-- Enable aerial support
|
||||||
|
require("aerial").on_attach(client, bufnr)
|
||||||
end
|
end
|
||||||
|
|
||||||
local lsp_flags = {
|
local lsp_flags = {
|
||||||
|
|
11
lualine_config.lua
Normal file
11
lualine_config.lua
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
require('lualine').setup{
|
||||||
|
options = {
|
||||||
|
icons_enabled = false,
|
||||||
|
theme = 'auto',
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
-- lualine_x = {'encoding', 'fileformat', 'filetype'},
|
||||||
|
lualine_x = {'aerial', 'filetype'}
|
||||||
|
},
|
||||||
|
extensions = {'aerial', 'fugitive', 'fzf', 'nerdtree'}
|
||||||
|
}
|
Loading…
Reference in a new issue