       (interactive)
       (let ((ffip-patterns patterns))
         (find-file-in-project)))))
-
-
 
 ;; Find file in project, with specific patterns
 (global-unset-key (kbd "C-x C-o"))

           (insert "~/")
         (call-interactively 'self-insert-command))))))

(require 'xterm-color)
(add-hook 'shell-mode-hook 
          'ansi-color-for-comint-mode-on)

(require 'edit-server)
(edit-server-start)

(load "server")
(unless (server-running-p) (server-start))

(add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.xsl\\'" . xml-mode))

(use-package undo-tree
  :ensure t)

(use-package clojure-mode
  :ensure t)

(use-package cider
  :ensure t)

(use-package clj-refactor
  :ensure t)

(use-package rainbow-delimiters
  :ensure t)

(use-package paredit
  :ensure t)
(add-hook 'clojure-mode-hook 'paredit-mode)
(add-hook 'cider-repl-mode-hook 'paredit-mode)
(add-hook 'emacs-lisp-mode-hook 'paredit-mode)

(use-package browse-kill-ring
  :ensure t)
(global-set-key (kbd "C-c y") 'browse-kill-ring)

(use-package bm
  :ensure t)
(global-set-key (kbd "<C-f2>") 'bm-toggle)
(global-set-key (kbd "<f2>") 'bm-next)
(global-set-key (kbd "<S-f2>") 'bm-previous)
;; Allow cross-buffer 'next'
;; (setq bm-cycle-all-buffers t)

(use-package bookmark+
  :ensure t)

(use-package browse-kill-ring+
  :ensure t)

(use-package project-persist
  :ensure t)
(project-persist-mode t)

(use-package helm-descbinds
  :ensure t)

(use-package emacs-eclim
  :ensure t)
(require 'eclim)
(global-eclim-mode)
;; (require 'eclimd)

(use-package company
  :ensure t
  :config
  (add-hook 'after-init-hook 'global-company-mode))

;; regular auto-complete initialization
(require 'auto-complete-config)
(ac-config-default)

;; add the emacs-eclim source
(require 'ac-emacs-eclim-source)
(ac-emacs-eclim-config)

(require 'company-emacs-eclim)
(company-emacs-eclim-setup)
(global-company-mode t)
(define-key eclim-mode-map (kbd "C-c C-c") 'company-complete)


(global-set-key "\C-x\C-m" 'execute-extended-command)
(global-set-key "\C-c\C-m" 'execute-extended-command)

(use-package guide-key
  :ensure t)
(setq guide-key/guide-key-sequence t)
(guide-key-mode 1)

(use-package flycheck
  :ensure t)

(setq custom-file "~/.emacs.d/custom.el")
(load custom-file 'noerror)

(setq-default tab-width 4)
(setq js-indent-level 2)
(setq jsx-indent-level 2)
(setq c-basic-indent 4)
(setq tab-width 4)
(setq indent-tabs-mode nil)
(winner-mode 1)



(setq help-at-pt-display-when-idle t)
(setq help-at-pt-timer-delay 0.1)
(help-at-pt-set-timer)
(setq visible-bell t)
(setq speedbar-directory-unshown-regexp "^\\(CVS\\|RCS\\|SCCS\\|\\.\\.*$\\)\\'")
(setq tramp-default-method "ssh")
(setq tramp-verbose 9)


(autoload 'bash-completion-dynamic-complete 
  "bash-completion"
  "BASH completion hook")
(add-hook 'shell-dynamic-complete-functions
  'bash-completion-dynamic-complete)
(add-hook 'shell-command-complete-functions
  'bash-completion-dynamic-complete)

(autoload 'bash-completion-dynamic-complete 
  "bash-completion"
  "BASH completion hook")
(add-hook 'shell-dynamic-complete-functions
  'bash-completion-dynamic-complete)
(add-hook 'shell-command-complete-functions
  'bash-completion-dynamic-complete)

;; keyboard bindings for lookup
(define-key 'help-command (kbd "C-l") 'find-library)
(define-key 'help-command (kbd "C-f") 'find-function)
(define-key 'help-command (kbd "C-k") 'find-function-on-key)
(define-key 'help-command (kbd "C-v") 'find-variable)
                                       
(defun other-window-backward (&optional n)
    "Select Nth previous window."
    (interactive "P")    
    (other-window (- (prefix-numeric-value n))))

(global-set-key (kbd "C-x C-p") 'other-window-backward)
(global-set-key (kbd "C-x C-n") 'other-window)
(global-set-key (kbd "C-+") 'text-scale-increase)
(global-set-key (kbd "C--") 'text-scale-decrease)

;; Wind-move
(global-set-key (kbd "C-c C-j") 'windmove-left)
(global-set-key (kbd "C-c C-k") 'windmove-down)
(global-set-key (kbd "C-c C-p") 'windmove-up)
(global-set-key (kbd "C-c C-n") 'windmove-right)

(require 'buffer-move)
(global-set-key (kbd "<C-S-up>")     'buf-move-up)
(global-set-key (kbd "<C-S-down>")   'buf-move-down)
(global-set-key (kbd "<C-S-left>")   'buf-move-left)
(global-set-key (kbd "<C-S-right>")  'buf-move-right)

;; Move more quickly
(global-set-key (kbd "C-S-n")
                (lambda ()
                  (interactive)
                  (ignore-errors (next-line 5))))

(global-set-key (kbd "C-S-p")
                (lambda ()
                  (interactive)
                  (ignore-errors (previous-line 5))))

(global-set-key (kbd "C-S-f")
                (lambda ()
                  (interactive)
                  (ignore-errors (forward-char 5))))

(global-set-key (kbd "C-S-b")
                (lambda ()
                  (interactive)
                  (ignore-errors (backward-char 5))))


;; Function to create new functions that look for a specific pattern
(defun ffip-create-pattern-file-finder (&rest patterns)
