diff options
Diffstat (limited to 'users/ryan/modules')
| -rw-r--r-- | users/ryan/modules/default.nix | 15 | ||||
| -rw-r--r-- | users/ryan/modules/nvim/default.nix | 53 | ||||
| -rw-r--r-- | users/ryan/modules/nvim/extraConfigs/after/ftplugin/mail/custom.vim | 2 | ||||
| -rw-r--r-- | users/ryan/modules/nvim/extraConfigs/after/ftplugin/markdown/custom.vim | 2 | ||||
| -rw-r--r-- | users/ryan/modules/nvim/init.lua | 26 | ||||
| -rw-r--r-- | users/ryan/modules/nvim/init.vim | 27 |
6 files changed, 125 insertions, 0 deletions
diff --git a/users/ryan/modules/default.nix b/users/ryan/modules/default.nix new file mode 100644 index 0000000..55af9ec --- /dev/null +++ b/users/ryan/modules/default.nix | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | { lib, ... }: | ||
| 2 | let | ||
| 3 | entries = builtins.readDir ./.; | ||
| 4 | |||
| 5 | modulesDirs = lib.filterAttrs | ||
| 6 | (name: type: | ||
| 7 | type == "directory" && | ||
| 8 | builtins.pathExists (./. + "/${name}/default.nix")) | ||
| 9 | entries; | ||
| 10 | in | ||
| 11 | { | ||
| 12 | imports = map | ||
| 13 | (name: ./${name}) | ||
| 14 | (builtins.attrNames modulesDirs); | ||
| 15 | } | ||
diff --git a/users/ryan/modules/nvim/default.nix b/users/ryan/modules/nvim/default.nix new file mode 100644 index 0000000..83c9e1f --- /dev/null +++ b/users/ryan/modules/nvim/default.nix | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | {config, lib, pkgs, ...}: | ||
| 2 | |||
| 3 | with lib; | ||
| 4 | |||
| 5 | let | ||
| 6 | cfg = config.ryan.neovim; | ||
| 7 | in | ||
| 8 | { | ||
| 9 | options.ryan.neovim.enable = mkEnableOption "Neovim"; | ||
| 10 | |||
| 11 | config = mkIf cfg.enable { | ||
| 12 | programs.neovim = { | ||
| 13 | enable = true; | ||
| 14 | |||
| 15 | extraConfig = builtins.readFile ./init.vim; | ||
| 16 | |||
| 17 | initLua = builtins.readFile ./init.lua; | ||
| 18 | |||
| 19 | plugins = with pkgs.vimPlugins; [ | ||
| 20 | vim-pandoc | ||
| 21 | vim-pandoc-syntax | ||
| 22 | vim-table-mode | ||
| 23 | |||
| 24 | tokyonight-nvim | ||
| 25 | lualine-nvim | ||
| 26 | nvim-web-devicons | ||
| 27 | |||
| 28 | coq_nvim | ||
| 29 | #coq-artifacts | ||
| 30 | |||
| 31 | (nvim-treesitter.withPlugins (p: [ | ||
| 32 | p.zig | ||
| 33 | p.go | ||
| 34 | p.python | ||
| 35 | p.vim | ||
| 36 | ])) | ||
| 37 | |||
| 38 | #transparent-nvim | ||
| 39 | marks-nvim | ||
| 40 | leap-nvim | ||
| 41 | ]; | ||
| 42 | |||
| 43 | extraPackages = with pkgs; [ | ||
| 44 | pyright | ||
| 45 | gopls | ||
| 46 | zls | ||
| 47 | ]; | ||
| 48 | |||
| 49 | }; | ||
| 50 | |||
| 51 | xdg.configFile."nvim/after".source = ./extraConfigs/after; | ||
| 52 | }; | ||
| 53 | } | ||
diff --git a/users/ryan/modules/nvim/extraConfigs/after/ftplugin/mail/custom.vim b/users/ryan/modules/nvim/extraConfigs/after/ftplugin/mail/custom.vim new file mode 100644 index 0000000..75078e5 --- /dev/null +++ b/users/ryan/modules/nvim/extraConfigs/after/ftplugin/mail/custom.vim | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | setlocal tw=0 wm=0 | ||
| 2 | setlocal wrap linebreak | ||
diff --git a/users/ryan/modules/nvim/extraConfigs/after/ftplugin/markdown/custom.vim b/users/ryan/modules/nvim/extraConfigs/after/ftplugin/markdown/custom.vim new file mode 100644 index 0000000..96aac6e --- /dev/null +++ b/users/ryan/modules/nvim/extraConfigs/after/ftplugin/markdown/custom.vim | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | "Used to overwrite table behavior in markdown files | ||
| 2 | let b:table_mode_corner='+' | ||
diff --git a/users/ryan/modules/nvim/init.lua b/users/ryan/modules/nvim/init.lua new file mode 100644 index 0000000..2686f15 --- /dev/null +++ b/users/ryan/modules/nvim/init.lua | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | require('lualine').setup() | ||
| 2 | local coq = require 'coq' | ||
| 3 | --require("transparent") | ||
| 4 | --require("mason").setup() | ||
| 5 | --require("mason-lspconfig").setup { | ||
| 6 | -- ensure_installed = { "pyright" }, | ||
| 7 | -- } | ||
| 8 | |||
| 9 | -- nvim marks | ||
| 10 | require'marks'.setup { | ||
| 11 | default_mappings = true | ||
| 12 | } | ||
| 13 | |||
| 14 | -- Leap keybinds | ||
| 15 | config = function(_, opts) | ||
| 16 | vim.keymap.set({'n', 'x', 'o'}, 's', '<Plug>(leap-forward)') | ||
| 17 | vim.keymap.set({'n', 'x', 'o'}, 'S', '<Plug>(leap-backward)') | ||
| 18 | vim.keymap.set({'n', 'x', 'o'}, 'gs', '<Plug>(leap-from-window)') | ||
| 19 | end | ||
| 20 | |||
| 21 | --require'nvim-treesitter'.install { 'zig','go','python','vim' } | ||
| 22 | |||
| 23 | vim.opt.conceallevel = 2 | ||
| 24 | vim.opt.concealcursor = nc | ||
| 25 | |||
| 26 | --local lspconfig = require('lspconfig') | ||
diff --git a/users/ryan/modules/nvim/init.vim b/users/ryan/modules/nvim/init.vim new file mode 100644 index 0000000..8a4d54e --- /dev/null +++ b/users/ryan/modules/nvim/init.vim | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | set nu rnu | ||
| 2 | imap kj <Esc> | ||
| 3 | set ts=4 | ||
| 4 | set sw=4 | ||
| 5 | set sts=4 | ||
| 6 | set et | ||
| 7 | set mouse= | ||
| 8 | set cursorline | ||
| 9 | set cc=79 | ||
| 10 | |||
| 11 | "Load Theme | ||
| 12 | colorscheme tokyonight-night | ||
| 13 | |||
| 14 | "vim-pandoc config | ||
| 15 | let g:pandoc#modules#disabled = ['spell', 'folding'] | ||
| 16 | |||
| 17 | "vim-table-mode config | ||
| 18 | let g:table_mode_corner_corner='+' | ||
| 19 | let g:table_mode_header_fillchar='=' | ||
| 20 | |||
| 21 | "pandoc render and open preview | ||
| 22 | command Pv AsyncRun zathura '%:r.pdf' | ||
| 23 | command Rd silent exec "!pandoc -t pdf -o %:r.pdf --from=markdown+escaped_line_breaks -V geometry:margin=1in %" | ||
| 24 | command Rr exec "!pandoc -t pdf -o %:r.pdf --from=markdown+escaped_line_breaks -V geometry:margin=1in %" | ||
| 25 | |||
| 26 | "Auto-rerender markdown files to pdf | ||
| 27 | autocmd BufWritePost *.mkd :Rd | ||
