Coder Social home page Coder Social logo

dotfiles's Introduction

dotfiles

My dotfiles for configuring vim/bash/etc. Please feel free to use/copy/modify any of the files here for your own usage. Hope it makes your development environment a little snazzier.

For convenience, this repository has an install script at its root. This will clean up any current dotfiles and install the configuration to their appropriate directories. Here are the steps to run:

  1. git clone [email protected]:dencold/dotfiles.git
  2. cd dotfiles
  3. ./install.sh

That's it! You should be able to open a new terminal session and benefit from the configuration.

Notes

The vim dotfiles use the fantastic pathogen package by @tpope for plugin management. To make it easy to pull down the plugins used by .vimrc, I store them as git submodules in this repository. This requires a little more work after the initial clone as git does not pull submodules automatically. Read on young padawan...

Submodule pull

Once you've cloned the dotfiles repo follow these steps to get the submodule code.

  1. git submodule init vim/bundle
  2. git submodule update vim/bundle

Now if you cd into any of the subdirectories in the bundle directory, you'll see all of the source has been pulled down.

Also note that the install script will do this automatically for you as well.

Some helpful reference from the git book.

Adding new packages

If you'd like to add additional packages to pathogen, follow these steps:

  1. Locate the package's repository link (e.g. https://github.com/fatih/vim-go.git)

  2. Add it as a submodule in the vim/bundle directory:

    git submodule add https://github.com/fatih/vim-go.git \
        vim/bundle/vim-go
    
  3. Run the install script at the dotfiles root: ./install.sh

  4. Restart vim and you should see the new package installed.

  5. Last bit of housekeeping, we'll want to commit the package to our git repository. Do so with the following commands:

    git add .gitmodules vim/bundle/vim-go
    git commit
    

Removing unwanted packages

Removing packages is a litle more involved. There isn't a dedicated git command for deleting submodules so we have some extra hoops to go through. A good reference here is this entry on stackoverflow. Here are the steps:

  1. Delete the relevant section from the .gitmodules file
  2. Stage the .gitmodules changes: git add .gitmodules
  3. Delete the relevant section from .git/config
  4. Run git rm --cached path_to_submodule (no trailing slash)
  5. Run rm -rf .git/modules/path_to_submodule
  6. Commit: git commit -m "Removed submodule <name>"
  7. Delete the now untracked submodule files: rm -rf path_to_submodule

You once you are done with those steps, you can re-run the install.sh script and the package will be removed.

dotfiles's People

Contributors

dencold avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

henry-wu-1130

dotfiles's Issues

Remove folding marks in vimrc

Right new we have config like the following in our vimrc files:

" save session
nnoremap <leader>s :mksession<CR>
" }}}
" Spacing {{{
set tabstop=4     " set 4 spaces per tab
set softtabstop=4 " set 4 visual spaces per tab
set expandtab     " tabs become spaces
"filetype indent on " sets per-filetype spacing options
" }}}
" UI options {{{
set number        " gives us line numbers on side
set showcmd       " shows us the last command at bottom
set cursorline    " highlights the current line
set wildmenu      " command menu autocomplete
set lazyredraw    " laissez-faire redraw
set showmatch     " match brackets/parens/etc.
set laststatus=2  " required for airplane plugin
"}}}

I used to think this kind of folding would be helpful...not anymore. Remove it and replace it with simple comments for sectional highlights.

Restructure $HOME/tmp folder

All temp files (mostly the autosaves from vim) are getting dumped into $HOME/tmp. Would like to restructure this and have it be more organized. Vim should probably have its own hidden directory that is separate from the general tmp folder. Look to find out what other system processes are using the temp folder and see if we need to split them off into other subdirs as well.

Explore vim -> clipboard copying

Right now when we yank lines in vim, it does not store in the system clipboard (at least on linux, double-check in os x).

I remember reading somewhere that you can enable vim to automatically add to the system keyboard, either through a special buffer or some parameter in .vimrc.

Read up on the options here and get this set so that when we copy something in vim, it's available system-wide.

Add custom aliases

Now that we have a dedicated dotfile just for aliases, let's add some helpful commands for services I use a bit:

We should create individual aliases for those commands so that they are available from command line.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.