aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2022-06-04 13:33:39 +0100
committerJuan J. Martinez <jjm@usebox.net>2022-06-04 13:33:39 +0100
commit736b7d36fc49c1c16dadc54210a286efb5d644f3 (patch)
tree405eddf6ec8a6b2bcfb96d09584ec587c74ce8db
parent46b3fcde0407d8919f272e21403acf88c9f6edca (diff)
downloaddotnvim-736b7d36fc49c1c16dadc54210a286efb5d644f3.tar.gz
dotnvim-736b7d36fc49c1c16dadc54210a286efb5d644f3.zip
First step to move to only nvim
-rw-r--r--README.md25
-rw-r--r--Xresources (renamed from xresources)3
-rw-r--r--init.vim127
-rw-r--r--plugins.vim90
-rwxr-xr-xsetup17
-rw-r--r--tmux.conf2
6 files changed, 228 insertions, 36 deletions
diff --git a/README.md b/README.md
index 873f1cc..fd93adf 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,6 @@
-# My ~/.vim
+# My neovim & dot files
+
+This is a work in progress!
Managed by [vim-plug](https://github.com/junegunn/vim-plug).
@@ -8,20 +10,9 @@ For further information on installed plugins:
## Using it in a new location
-**Since I moved to Tokyo Night theme, vim won't work**
-
-My repo is in `~/.vim/`! You shouldn't have a `~/.vimrc` or `~/.vim` directory.
-
- cd && git clone --recursive https://github.com/reidrac/dotvim.git .vim
-
-Create a `.vimrc` with:
+This repo should be in `~/.config/nvim/`!
- runtime vimrc
-
-This can be also be used to customise your local vim configuration without
-having uncommitted changes in your repository.
-
-In case of neovim, you can link the provided `init.vim` into `~/.config/nvim/init.vim`.
+git clone --recursive https://github.com/reidrac/dotvim.git ~/.config/nvim
Then it is recommended you run:
@@ -33,7 +24,7 @@ you can commit and push the updated version.
## Adding plugins
-Add a new `Plug` entry in `~/.vim/vimrc`.
+Add a new `Plug` entry in `~/.config/plugins.vim`.
Then run:
@@ -49,7 +40,3 @@ Remove the `Plug` line and run:
:PlugClean
-## TODO
-
-- Convert all to lua and support only nvim.
-
diff --git a/xresources b/Xresources
index 3e3665c..b3abe14 100644
--- a/xresources
+++ b/Xresources
@@ -1,3 +1,6 @@
+! this may be different in ytour system
+Xcursor.theme:Adwaita
+
! Sensible defaults
XTerm.vt100.locale: false
XTerm.vt100.utf8: true
diff --git a/init.vim b/init.vim
index 29d3bb7..0f5da8c 100644
--- a/init.vim
+++ b/init.vim
@@ -1,23 +1,118 @@
-set runtimepath^=~/.vim runtimepath+=~/.vim/after
-let &packpath = &runtimepath
+" for long lines
+set wrap
-source ~/.vimrc
+" tab business
+set tabstop=8
+set softtabstop=4
+set shiftwidth=4
+set expandtab
-" for LSC support
+set autoindent
+
+" syntax highlighting
+syntax on
+
+set nohlsearch
+
+" try to detect filetypes
+filetype on
+
+" enable loading indent file for filetype
+filetype plugin indent on
+
+" line numbers
+set number
+
+" cursor line
+set cursorline
+
+" enable mouse
+set mouse=a
+
+" set term title
+set title
+set titleold=
+
+source ~/.config/nvim/plugins.vim
+
+set laststatus=2
+
+" vim-autoformat (C-F5)
+"
+noremap <F29> :Autoformat<CR>
+au BufWrite *.py,*.c,*.h,*.cpp :Autoformat
+
+" enable omnicompletion
+set omnifunc=syntaxcomplete#Complete
+
+" looks nice
+set termguicolors
+set background=dark
+
+let g:tokyonight_italic_keywords = 0
+
+colorscheme tokyonight
+
+" toggle spell check
+map <leader>s :set spell! spelllang=en_gb<CR>
+
+" show tabs and EOL whitespace
+:set list listchars=tab:»·,trail:·
+
+" for tmux, screen, etc
+set t_ut=
+
+" default is too slow
+set updatetime=500
+
+" re-read the file if changed (if possible)
+set autoread
+au BufEnter,CursorHold,CursorHoldI * silent! checktime
+
+" NERDTree
+"
+map <leader>n :NERDTreeToggle<CR>
+let NERDTreeQuitOnOpen=1
+
+" Telescope
"
-" general
-if has('nvim-0.6.1')
- source ~/.vim/lsp.lua
- source ~/.vim/treesitter.lua
-end
+nnoremap <leader>f <cmd>Telescope find_files<CR>
+nnoremap <leader>B <cmd>Telescope buffers<CR>
+
+"" gen_tags.vim (requires GNU global, aka gtags)
+" disable ctags completely, use it through gtags plugin
+let g:loaded_gentags#ctags = 1
+
+" vimwiki
+"
+let g:vimwiki_list = [{'path': '~/textfiles/',
+ \ 'syntax': 'markdown', 'ext': '.md'}]
+let g:vimwiki_global_ext = 0
+
+" vim-markdown
+"
+let g:vim_markdown_folding_disabled = 1
+let g:vim_markdown_frontmatter = 1
+let g:vim_markdown_conceal_code_blocks = 0
+autocmd FileType markdown setlocal conceallevel=2
+
+" git gutter to play nice with others
+"
+let g:gitgutter_sign_allow_clobber = 0
+
+" Required for operations modifying multiple buffers like rename.
+set hidden
-if has('nvim-0.5')
- source ~/.vim/lualine.lua
-end
+" better for some messages
+set cmdheight=2
+set shortmess+=c
+" for lsc erros
+set shortmess-=F
-" scala and metals
-source ~/.vim/metals.vim
+" disable preview when doing auto-complete
+set completeopt-=preview
-" auto-complete
-source ~/.vim/cmp.vim
+" Set completeopt to have a better completion experience
+set completeopt=menuone,noinsert,noselect
+" EOF
diff --git a/plugins.vim b/plugins.vim
new file mode 100644
index 0000000..e75c293
--- /dev/null
+++ b/plugins.vim
@@ -0,0 +1,90 @@
+" plugin dependent conf starts
+
+call plug#begin('~/.config/nvim/plugged')
+
+" git
+Plug 'tpope/vim-fugitive', { 'tag': 'v3.6' }
+Plug 'airblade/vim-gitgutter'
+
+" tmux
+Plug 'tmux-plugins/vim-tmux-focus-events'
+Plug 'roxma/vim-tmux-clipboard'
+Plug 'wincent/terminus'
+
+" life improvements
+Plug 'folke/tokyonight.nvim', { 'branch': 'main' }
+Plug 'scrooloose/nerdtree'
+Plug 'Chiel92/vim-autoformat'
+Plug 'jsfaint/gen_tags.vim'
+Plug 'godlygeek/tabular'
+Plug 'vimwiki/vimwiki'
+
+" language support
+Plug 'plasticboy/vim-markdown'
+Plug 'samsaga2/vim-z80'
+Plug 'tomtom/tcomment_vim'
+
+if has('nvim-0.5')
+ " status line
+ Plug 'nvim-lualine/lualine.nvim'
+ " general lua
+ Plug 'nvim-lua/popup.nvim'
+ Plug 'nvim-lua/plenary.nvim'
+ " scala
+ Plug 'scalameta/nvim-metals'
+ if has('nvim-0.5.1')
+ Plug 'nvim-telescope/telescope.nvim'
+ end
+ " auto complete
+ Plug 'hrsh7th/nvim-cmp'
+ Plug 'hrsh7th/cmp-nvim-lsp'
+ Plug 'hrsh7th/cmp-vsnip'
+ Plug 'hrsh7th/vim-vsnip'
+
+ " for LSP
+ Plug 'kyazdani42/nvim-web-devicons'
+ Plug 'folke/trouble.nvim'
+
+ " life improvements
+ Plug 'ojroques/nvim-bufdel'
+
+ " learning
+ Plug 'folke/which-key.nvim'
+end
+
+if has('nvim-0.6.1')
+ " lsp
+ Plug 'neovim/nvim-lspconfig'
+ Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
+end
+
+call plug#end()
+
+if has('nvim-0.5')
+:lua << EOF
+ -- BufKil
+ require('bufdel').setup {
+ next = 'cycle',
+ quit = false,
+ }
+ -- which-key
+ require("which-key").setup { }
+EOF
+
+ source ~/.config/nvim/lualine.lua
+end
+
+" for LSC support
+"
+if has('nvim-0.6.1')
+ source ~/.config/nvim/lsp.lua
+ source ~/.config/nvim/treesitter.lua
+
+ " scala and metals
+ source ~/.config/nvim/metals.vim
+end
+
+
+" auto-complete
+source ~/.config/nvim/cmp.vim
+
diff --git a/setup b/setup
new file mode 100755
index 0000000..d381799
--- /dev/null
+++ b/setup
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+set +e
+
+echo "Setting symlinks for tmux..."
+rm -f ~/.tmux.conf
+ln -s ~/.config/nvim/tmux.conf ~/.tmux.conf
+
+echo "Setting symlinks for wezterm..."
+mkdir -p ~/.config/wezterm/colors/
+rm -f ~/.config/wezterm/colors/wezterm_tokyonight_storm.toml
+ln -s ~/.config/nvim/wezterm_tokyonight_storm.toml ~/.config/wezterm/colors/wezterm_tokyonight_storm.toml
+rm -f ~/.config/wezterm/wezterm.lua
+ln -s ~/.config/nvim/wezterm.lua ~/.config/wezterm/wezterm.lua
+
+echo "Done"
+
diff --git a/tmux.conf b/tmux.conf
index b3cca83..7e492e5 100644
--- a/tmux.conf
+++ b/tmux.conf
@@ -50,5 +50,5 @@ bind h split-window -v -c "#{pane_current_path}"
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0
-source-file ~/.vim/tmux_tokyonight_storm.tmux
+source-file ~/.config/nvim/tmux_tokyonight_storm.tmux