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:
Edward Litherland-Smith 2022-08-15 15:20:15 +01:00
parent 808d53cdd6
commit fc3f8d5901
4 changed files with 51 additions and 46 deletions

18
init.lua Normal file
View 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
}

View file

@ -21,15 +21,15 @@ Plug 'mileszs/ack.vim'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'liuchengxu/vista.vim'
Plug 'stevearc/aerial.nvim'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-commentary'
Plug 'airblade/vim-gitgutter'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'nvim-lualine/lualine.nvim'
Plug 'kyazdani42/nvim-web-devicons'
Plug 'christoomey/vim-tmux-navigator'
Plug 'jpalardy/vim-slime'
Plug 'akinsho/toggleterm.nvim', {'tag' : 'v2.*'}
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
@ -44,6 +44,7 @@ call plug#end()
set mouse=nv
let g:python3_host_prog = '~/.pyenv/versions/neovim3/bin/python'
luafile ~/.vim/init.lua
luafile ~/.vim/lsp_config.lua
map ; :Files<CR>
@ -55,7 +56,6 @@ if exists('+termguicolors') && ($COLORTERM == "24bit" || $COLORTERM == "truecolo
set termguicolors
endif
colorscheme onehalfdark
let g:airline_theme='onehalfdark'
set cursorline
let mapleader=","
@ -86,16 +86,12 @@ set autoindent
set smartindent
filetype plugin indent on
let g:vista_default_executive = 'nvim_lsp'
let g:vista_fzf_preview = ['right:50%']
imap jk <Esc>
command Bd b# | bd #
command! BufOnly silent! execute "%bd|e#|bd#"
nnoremap <Leader>b :buffers<CR>:buffer<Space>
nnoremap <leader>n :NERDTreeFocus<CR>
nnoremap <leader>k :Vista<CR>
nnoremap <leader>; :Vista finder<CR>
nnoremap <leader>; :call aerial#fzf()<CR>
nnoremap <C-n> :NERDTree<CR>
nnoremap <C-t> :NERDTreeToggle<CR>
nnoremap <C-f> :NERDTreeFind<CR>
@ -108,39 +104,3 @@ set splitbelow
set splitright
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

View file

@ -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', '<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
-- after the language server attaches to the current buffer
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', 'gr', vim.lsp.buf.references, bufopts)
vim.keymap.set('n', '<space>f', vim.lsp.buf.formatting, bufopts)
-- Enable aerial support
require("aerial").on_attach(client, bufnr)
end
local lsp_flags = {

11
lualine_config.lua Normal file
View 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'}
}