[2024-05-09] Adding updated nvim config, stripping down .vimrc

This commit is contained in:
Andrew Conlin 2024-05-09 18:23:20 +01:00 committed by Andrew Conlin
parent a2b0423cc9
commit 762776ef54
6 changed files with 103 additions and 44 deletions

42
.vimrc
View File

@ -3,43 +3,16 @@ filetype on
filetype plugin on
filetype indent on
syntax on
set number
set relativenumber
set cursorline
set cursorcolumn
" wildmenu
set wildmenu
set wildmode=list:longest
set wildignore=*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx
" plugins
call plug#begin()
Plug 'morhetz/gruvbox'
Plug 'vim-airline/vim-airline'
Plug 'ghifarit53/tokyonight-vim'
Plug 'airblade/vim-gitgutter'
call plug#end()
" relative line numbers
set number
set relativenumber
" colours
set bg=dark
set termguicolors
colorscheme tokyonight
" backspace fix on windows
set nocompatible
set backspace=indent,eol,start
" wrap text and split on words
set wrap
set linebreak
set nolist
" don't show mode as it is shown in airline
set noshowmode
" airline fonts
let g:airline_powerline_fonts = 0
colo tokyonight
" have j and k navigate visual lines rather than logical ones
nmap j gj
@ -48,10 +21,3 @@ nmap k gk
" use H and L for beginning/end of line
nmap H ^
nmap L $
" yank to system clipboard
set clipboard=unnamed
" vim-gitgutter
set updatetime=100
set signcolumn=yes

View File

@ -3,8 +3,10 @@ let &packpath=&runtimepath
source ~/.vimrc
call plug#begin()
Plug 'morhetz/gruvbox'
Plug 'vim-airline/vim-airline'
"Plug 'morhetz/gruvbox'
Plug 'ellisonleao/gruvbox.nvim'
"Plug 'vim-airline/vim-airline'
"Plug 'vim-airline/vim-airline-themes'
Plug 'ghifarit53/tokyonight-vim'
Plug 'airblade/vim-gitgutter'
Plug 'folke/tokyonight.nvim'
@ -15,10 +17,24 @@ Plug 'nvim-neo-tree/neo-tree.nvim', { 'branch': 'v3.x' }
Plug 'lewis6991/gitsigns.nvim' " OPTIONAL: for git status
Plug 'nvim-tree/nvim-web-devicons' " OPTIONAL: for file icons
Plug 'romgrk/barbar.nvim'
Plug 'freddiehaddad/feline.nvim'
"Plug 'epwalsh/obsidian.nvim'
"Plug 'hrsh7th/nvim-cmp'
call plug#end()
colo tokyonight-night
set bg=dark
"colo gruvbox
"let g:airline_theme = 'gruvbox'
"let g:airline_powerline_fonts = 1
if exists("g:neovide")
set guifont=Geist\ Mono:h9
endif
set noshowmode
"if exists("g:neovide")
" set guifont=MesloLGM_Nerd_Font_Mono:h10:cANSI:qDRAFT
"endif
set updatetime=100
set signcolumn=yes
" .config/nvim/lua/init.lua
lua require('init')

2
nvim/lua/init.lua Normal file
View File

@ -0,0 +1,2 @@
require('plugins.gruvbox')
require('plugins.feline')

View File

@ -0,0 +1,53 @@
-- Initialize the components table
local components = {
active = {},
inactive = {}
}
local config = {}
-- Insert three sections (left, mid and right) for the active statusline
table.insert(components.active, {})
table.insert(components.active, {})
table.insert(components.active, {})
components.active[1][1] = {
provider = 'vi_mode',
hl = function()
return {
name = require('feline.providers.vi_mode').get_mode_highlight_name(),
fg = require('feline.providers.vi_mode').get_mode_color(),
style = 'bold'
}
end,
right_sep = {
str = 'right',
hl = {
fg = 'fg',
bg = 'bg'
}
},
-- Uncomment the next line to disable icons for this component and use the mode name instead
icon = ''
}
components.active[1][2] = {
provider = 'line_percentage',
hl = {
fg = 'blue',
},
left_sep = {
str = 'vertical_bar'
}
}
components.active[3][1] = {
provider = 'time'
}
local custom_providers = {
time = function()
return tostring(vim.fn.strftime('%c'))
end
}
config.components = components
config.custom_providers = custom_providers
local theme = require('themes.gruvbox')
require('feline').setup(config)
require('feline').use_theme(theme)

View File

@ -0,0 +1,2 @@
require('gruvbox').setup()
vim.cmd("colorscheme gruvbox")

View File

@ -0,0 +1,20 @@
-- :filter Gruvbox* highlight
local hex = function(n)
return string.format("#%06x", n)
end
local colo = function(n)
colour = vim.api.nvim_get_hl_by_name(n, true)
return hex(colour.foreground)
end
return {
bg = colo("GruvboxBg0"),
black = '#000000',
fg = colo("GruvboxFg0"),
green = colo("GruvboxGreen"),
blue = colo("GruvboxBlue"),
orange = colo("GruvboxOrange"),
red = colo("GruvboxRed"),
purple = colo("GruvboxPurple"),
white = '#FFFFFF',
yellow = colo("GruvboxYellow")
}