Skip to content

Commit 498bd2c

Browse files
committed
init
0 parents  commit 498bd2c

15 files changed

+1039
-0
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# lc-shell for Nix
2+
3+
This repository contains the Nix version of my Vim/ZSH/Tmux configuration called [lc-shell](https://github.com/lightcode/lc-shell).

default.nix

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{ config, pkgs, ... }:
2+
3+
{
4+
imports = [
5+
./tmux
6+
./vim
7+
./zsh
8+
];
9+
}

tmux/default.nix

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{ lib, pkgs, config, ... }:
2+
3+
with lib;
4+
5+
let cfg = config.lc-shell.tmux;
6+
in {
7+
options.lc-shell.tmux = {
8+
enable = mkEnableOption "tmux configuration";
9+
};
10+
11+
config = mkIf cfg.enable {
12+
programs.tmux = {
13+
enable = true;
14+
baseIndex = 1;
15+
escapeTime = 5;
16+
historyLimit = 50000;
17+
keyMode = "vi";
18+
terminal = "screen-256color";
19+
extraConfig = builtins.readFile ./tmux.conf;
20+
};
21+
};
22+
}

tmux/tmux.conf

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Key bindings
2+
unbind -n M-Left ; bind -n M-Left select-pane -L
3+
unbind -n M-Right ; bind -n M-Right select-pane -R
4+
unbind -n M-Up ; bind -n M-Up select-pane -U
5+
unbind -n M-Down ; bind -n M-Down select-pane -D
6+
7+
unbind -n M-PageUp ; bind -n M-PageUp previous-window
8+
unbind -n M-PageDown ; bind -n M-PageDown next-window
9+
10+
unbind M-Up ; bind -r M-Up resize-pane -U
11+
unbind M-Down ; bind -r M-Down resize-pane -D
12+
unbind M-Left ; bind -r M-Left resize-pane -L
13+
unbind M-Right ; bind -r M-Right resize-pane -R
14+
15+
unbind -n M-Space ; bind -n M-Space resize-pane -Z
16+
unbind -n M-Enter ; bind -n M-Enter choose-session
17+
18+
unbind r ; bind r source-file ~/.tmux.conf \; display "Reloaded!"
19+
unbind s ; bind s set-window-option synchronize-panes
20+
21+
unbind S ; bind-key S command-prompt "new-session -s %1"
22+
unbind M ; bind-key M choose-session "move-window -t %1 \; attach-session -t %1"
23+
24+
unbind -n M-1 ; bind-key -n M-1 select-window -t :1
25+
unbind -n M-2 ; bind-key -n M-2 select-window -t :2
26+
unbind -n M-3 ; bind-key -n M-3 select-window -t :3
27+
unbind -n M-4 ; bind-key -n M-4 select-window -t :4
28+
unbind -n M-5 ; bind-key -n M-5 select-window -t :5
29+
unbind -n M-6 ; bind-key -n M-6 select-window -t :6
30+
unbind -n M-7 ; bind-key -n M-7 select-window -t :7
31+
unbind -n M-8 ; bind-key -n M-8 select-window -t :8
32+
unbind -n M-9 ; bind-key -n M-9 select-window -t :9
33+
unbind -n M-0 ; bind-key -n M-0 select-window -t :10
34+
35+
# For tmux 1.9 and newer : make new windows start in the same directory as the current window
36+
unbind c ; bind c new-window -c "#{pane_current_path}"
37+
unbind % ; bind % split-window -h -c "#{pane_current_path}"
38+
unbind '"' ; bind '"' split-window -v -c "#{pane_current_path}"
39+
40+
# Status bar
41+
set-option -g status on # turn the status bar on
42+
set-option -gq status-utf8 on # set utf-8 for the status bar
43+
set-option -g status-interval 5 # set update frequencey (default 15 seconds)
44+
set-option -g status-justify centre # center window list for clarity
45+
set-option -g status-position bottom # position the status bar at bottom of screen
46+
47+
# Powerline-style theme
48+
set -g message-command-style "bg=colour237,fg=colour249"
49+
set -g message-style "bg=colour237,fg=colour249"
50+
set -g pane-active-border-style "fg=colour150"
51+
set -g pane-border-style "fg=colour237"
52+
set -g status "on"
53+
set -g status-bg "colour238"
54+
set -g status-justify "left"
55+
set -g status-left "#[fg=colour236,bg=colour150] #S #[fg=colour150,bg=colour238,nobold,nounderscore,noitalics]"
56+
set -g status-left-length "100"
57+
set -g status-right "#[fg=colour150,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour236,bg=colour150] #H "
58+
set -g status-right-length "100"
59+
setw -g window-status-activity-style "bg=colour238,fg=colour150,underscore"
60+
setw -g window-status-current-format "#[fg=colour238,bg=colour237,nobold,nounderscore,noitalics]#[fg=colour249,bg=colour237] #I | #W | #F#{?pane_synchronized,S,} #[fg=colour237,bg=colour238,nobold,nounderscore,noitalics]"
61+
setw -g window-status-format "#[fg=colour238,bg=colour238,nobold,nounderscore,noitalics]#[default] #I | #W #[fg=colour238,bg=colour238,nobold,nounderscore,noitalics]"
62+
setw -g window-status-separator ""
63+
setw -g window-status-style "bg=colour238,fg=colour150"

vim/default.nix

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
{ lib, pkgs, config, ... }:
2+
3+
with lib;
4+
5+
let cfg = config.lc-shell.vim;
6+
in {
7+
options.lc-shell.vim = {
8+
enable = mkEnableOption "vim configuration";
9+
};
10+
11+
config = mkIf cfg.enable {
12+
programs.neovim = let
13+
pastemode-vim = pkgs.vimUtils.buildVimPluginFrom2Nix {
14+
pname = "pastemode-vim";
15+
version = "2019-11-13";
16+
src = pkgs.fetchFromGitHub {
17+
owner = "lightcode";
18+
repo = "PasteMode.vim";
19+
rev = "1046b1efc0a85ee18a0f8cdbcb3d14a1743c1a1b";
20+
sha256 = "0bp4rwhj08mjafcpn0f27im21gvndaa5yqfv9apar0lzqk3wwgnv";
21+
};
22+
meta.homepage = "https://github.com/lightcode/PasteMode.vim";
23+
};
24+
in {
25+
enable = true;
26+
plugins = with pkgs.vimPlugins; [
27+
gruvbox
28+
pastemode-vim
29+
supertab
30+
vim-airline-themes
31+
vim-cue
32+
vim-gitgutter
33+
vim-nix
34+
35+
{
36+
plugin = vim-terraform;
37+
config = ''
38+
let g:terraform_fmt_on_save = 1
39+
'';
40+
}
41+
{
42+
plugin = vim-markdown;
43+
config = ''
44+
let g:vim_markdown_folding_disabled = 1
45+
'';
46+
}
47+
{
48+
plugin = vim-go;
49+
config = ''
50+
if executable('goimports')
51+
let g:go_fmt_command = 'goimports'
52+
endif
53+
'';
54+
}
55+
{
56+
plugin = vim-pencil;
57+
config = ''
58+
let g:pencil#autoformat = 0
59+
let g:pencil#conceallevel = 0
60+
let g:pencil#wrapModeDefault = 'soft'
61+
'';
62+
}
63+
{
64+
plugin = syntastic;
65+
config = ''
66+
let g:syntastic_always_populate_loc_list = 1
67+
let g:syntastic_auto_loc_list = 2
68+
let g:syntastic_check_on_open = 1
69+
let g:syntastic_check_on_wq = 1
70+
71+
" Here we can make check active or passive.
72+
" I made `rst` checking passive because it doesn't
73+
" handle Sphinx well.
74+
let g:syntastic_mode_map = {
75+
\ 'mode': 'active',
76+
\ 'active_filetypes': [],
77+
\ 'passive_filetypes': ['rst'] }
78+
79+
let g:syntastic_error_symbol = '✗'
80+
let g:syntastic_warning_symbol = '⚠'
81+
82+
let g:syntastic_python_checkers = ['flake8']
83+
let g:syntastic_go_checkers = ['go', 'golint', 'govet']
84+
let g:syntastic_javascript_checkers = ['jshint']
85+
let g:syntastic_yaml_checkers = ['yamllint']
86+
let g:syntastic_ansible_checkers = ['yaml/yamllint']
87+
'';
88+
}
89+
{
90+
plugin = ctrlp-vim;
91+
config = ''
92+
let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:12,results:12'
93+
let g:ctrlp_custom_ignore = {
94+
\ 'dir': '\v[\/](\.(git|hg|svn))$',
95+
\ 'file': '\v\.(exe|so|dll|class|png|jpg|jpeg)$' }
96+
if executable('ag')
97+
set grepprg=ag\ --nogroup\ --nocolor
98+
let g:ctrlp_user_command = 'ag %s -l --hidden --ignore .git --nocolor -g ""'
99+
endif
100+
'';
101+
}
102+
{
103+
plugin = vim-airline;
104+
config = ''
105+
set noshowmode
106+
107+
let g:airline_theme = 'bubblegum'
108+
let g:airline_skip_empty_sections = 1
109+
let g:airline_extensions = ['tabline', 'ctrlp', 'syntastic', 'whitespace']
110+
let g:airline#extensions#tabline#enabled = 1
111+
let g:airline#extensions#tabline#fnamemod = ':t'
112+
let g:airline#extensions#tabline#left_sep = ""
113+
let g:airline#extensions#tabline#left_alt_sep = ""
114+
let g:airline#extensions#tabline#right_sep = ""
115+
let g:airline#extensions#tabline#right_alt_sep = ""
116+
'';
117+
}
118+
];
119+
extraConfig = builtins.readFile ./vimrc;
120+
};
121+
};
122+
}

0 commit comments

Comments
 (0)